Skip to content

Commit

Permalink
Cleaning up some other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee94 committed Mar 18, 2024
1 parent cb92eb8 commit 2716eca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions idaes/core/util/parameter_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ def handle_error(self, model):
Output of handle_solver_error callback
"""
if self.config.handle_solver_error is None:
# No recourse specified, so success=False and results=None
return None, False
# No recourse specified, so results=None
return None
else:
args = self.config.handle_solver_error_arguments
if args is None:
Expand Down
6 changes: 3 additions & 3 deletions idaes/core/util/tests/test_parameter_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def test_handle_error_none(self):

results = psweep.handle_error(model)

assert results == (None, False)
assert results == None

@pytest.mark.unit
def test_handle_error(self):
Expand Down Expand Up @@ -1121,7 +1121,7 @@ def solve(model, *args, **kwargs):
raise Exception("Test exception")

def recourse(model):
return "foo", "bar"
return "foo"

spec2 = ParameterSweepSpecification()
spec2.set_sampling_method(UniformSampling)
Expand All @@ -1138,7 +1138,7 @@ def recourse(model):
results, success, error = psweep.execute_single_sample(1)

assert results == "foo"
assert success == "bar"
assert not success
assert error == "Test exception"

@pytest.fixture(scope="class")
Expand Down

0 comments on commit 2716eca

Please sign in to comment.