-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG+1] TST Ignore DeprecationWarning in test_auc_duplicate_values #11580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base on the discussion in
#11572 (comment)
this looks good to me, and I am +1 for merge.
that's also the fix I've used in #11570 now btw. That contains fixes for all deprecation warnings in the tests. |
I pushed a fix having to do with a slightly dangerous caveat of ignore_warnings: if you pass the warning class as the first argument, then the test is not run: from sklearn.utils.testing import ignore_warnings
@ignore_warnings(UserWarning)
def test():
1/0
The reason is that the first argument is the test callable. Maybe that could be fixed not sure. |
Yes, that is very tricky, I would have missed that in review as well. I agree, we should try to switch to |
The limitation with the pytest.mark.filterwarnings can only be used at a test level. There is no way to use a context manager, which sometimes is convenient when you just want to ignore a warning for a few lines. |
Resolved in #11570 |
Fixes #11572
See #11572 (comment) for details