Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Jul 25, 2024
1 parent a485dce commit a775c5b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import sys

import pytest

from bayes_opt.bayesian_optimization import Observable
from bayes_opt.event import Events
from bayes_opt.observer import _Tracker
Expand Down Expand Up @@ -84,10 +86,8 @@ def max(self):
assert tracker._previous_max_params is None

test_instance = MockInstance()
tracker._update_tracker("other_event", test_instance)
assert tracker._iterations == 0
assert tracker._previous_max is None
assert tracker._previous_max_params is None
with pytest.raises(ValueError, match="'other_event' is not a valid Events"):
tracker._update_tracker("other_event", test_instance)

tracker._update_tracker(Events.OPTIMIZATION_STEP, test_instance)
assert tracker._iterations == 1
Expand Down Expand Up @@ -121,6 +121,4 @@ def max(self):
CommandLine:
python tests/test_observer.py
"""
import pytest

pytest.main([__file__])

0 comments on commit a775c5b

Please sign in to comment.