Skip to content

Commit

Permalink
Adjust sys.exit() to AssertionError for clearer user-communication
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronzila committed Jul 27, 2023
1 parent bafb536 commit 30c3451
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dehb/optimizers/dehb.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, cs=None, f=None, dimensions=None, mutation_factor=None,
f"{self.mutation_factor}, crossover_prob={self.crossover_prob}, "\
f"strategy={self.strategy}, budget={self.max_budget}, " \
f"boundary_fix_type={self.fix_type})")
sys.exit()
raise AssertionError()
self.eta = eta
self.min_clip = min_clip
self.max_clip = max_clip
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dehb.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ class TestInitialization:
def test_higher_min_budget(self):
"""Test that verifies, that DEHB breaks if min_budget > max_budget."""
cs = create_toy_searchspace()
with pytest.raises(SystemExit):
with pytest.raises(AssertionError):
create_toy_optimizer(configspace=cs, min_budget=28, max_budget=27, eta=3,
objective_function=objective_function)

0 comments on commit 30c3451

Please sign in to comment.