Skip to content

Commit

Permalink
Add BotorchRecommender to deprecation test
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Nov 26, 2024
1 parent e366077 commit dfa7a70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ def test_migrated_metadata_attribute():
"allow_recommending_pending_experiments",
],
)
def test_migrated_allow_flags(flag):
@pytest.mark.parametrize("recommender_cls", [RandomRecommender, BotorchRecommender])
def test_migrated_allow_flags(flag, recommender_cls):
"""Passing and accessing the migrated 'allow_*' flags raises an error."""
with pytest.raises(DeprecationError, match=r"Passing 'allow_\*' flags"):
RandomRecommender(**{flag: True})
recommender_cls(**{flag: True})

with pytest.raises(DeprecationError, match=f"The attribute '{flag}' is no longer"):
getattr(RandomRecommender(), flag)
getattr(recommender_cls(), flag)

0 comments on commit dfa7a70

Please sign in to comment.