Skip to content

Commit 89f65dc

Browse files
committed
fix: tests
1 parent babdd1c commit 89f65dc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test_observer.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import sys
44

5+
import pytest
6+
57
from bayes_opt.bayesian_optimization import Observable
68
from bayes_opt.event import Events
79
from bayes_opt.observer import _Tracker
@@ -84,10 +86,8 @@ def max(self):
8486
assert tracker._previous_max_params is None
8587

8688
test_instance = MockInstance()
87-
tracker._update_tracker("other_event", test_instance)
88-
assert tracker._iterations == 0
89-
assert tracker._previous_max is None
90-
assert tracker._previous_max_params is None
89+
with pytest.raises(ValueError, match="'other_event' is not a valid Events"):
90+
tracker._update_tracker("other_event", test_instance)
9191

9292
tracker._update_tracker(Events.OPTIMIZATION_STEP, test_instance)
9393
assert tracker._iterations == 1
@@ -121,6 +121,4 @@ def max(self):
121121
CommandLine:
122122
python tests/test_observer.py
123123
"""
124-
import pytest
125-
126124
pytest.main([__file__])

0 commit comments

Comments
 (0)