-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Remove the use of assert_warns and assert_warns_message from the tests #19414
Copy link
Copy link
Closed
Copy link
Labels
Description
(Saving this for the upcoming sprints, ideally)
Let's remove the use of assert_warns, assert_warns_message
These should be replaced with the pytest context manager:
https://doc.pytest.org/en/reorganize-docs/recwarn.html
with pytest.warns(TheWarning, match="the expected message"):
function_call_here()For contributors: pick one of the modules, and please comment on this issue saying e.g. "I'm working on cluster/tests", to avoid other contributors choosing the same modules.
You can see all the occurrences of the entries that need to be removed with e.g. git grep "assert_warns" sklearn/ensemble/tests/.
Reactions are currently unavailable