Skip to content

Commit

Permalink
Test some run failure cases
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Feb 14, 2024
1 parent b45c03b commit db2b154
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/custom_test_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ def sparse_only(self) -> bool:

def __iter__(self):
yield custom_problem(name="custom")
yield custom_problem(name="custom_again") # test only_problem
21 changes: 21 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import qpbenchmark
from qpbenchmark import Results
from qpsolvers import SolverNotFound

from .custom_test_set import CustomTestSet

Expand Down Expand Up @@ -47,3 +48,23 @@ def test_only_solver(self):
include_timeouts=False,
)
self.assertEqual(len(self.results.df), 1)

def test_settings_not_found(self):
with self.assertRaises(ValueError):
qpbenchmark.run(
self.test_set,
self.results,
only_settings="unknown",
rerun=False,
include_timeouts=False,
)

def test_solver_not_found(self):
with self.assertRaises(SolverNotFound):
qpbenchmark.run(
self.test_set,
self.results,
only_solver="unknown",
rerun=False,
include_timeouts=False,
)

0 comments on commit db2b154

Please sign in to comment.