-
-
Notifications
You must be signed in to change notification settings - Fork 26k
TST Remove pytest.warns(None) and replace it with warnings.catch_warnings in test_pipeline.py #23089
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
TST Remove pytest.warns(None) and replace it with warnings.catch_warnings in test_pipeline.py #23089
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.
Thank you for the PR!
For future reviewers: From the PR that added this check: #9716, I think this check was to catch a deprecation warning in 0.18 that is no longer in the library.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
…o/scikit-learn into replace_warning_syntax
sklearn/tests/test_pipeline.py
Outdated
@@ -8,6 +8,7 @@ | |||
import itertools | |||
|
|||
import pytest | |||
import warnings |
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.
import warnings |
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.
Thanks. Have fixed this error.
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.
Thanks @lorentzbao
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Reference Issues/PRs
Related to #22572
What does this implement/fix? Explain your changes.
Replaces deprecated pytest.warns(None) in test_pipeline.py with a warnings.catch_warnings() context handler.
Any other comments?
・Replaced all deprecated pytest.warns(None) in test.pipeline.py.
・I think the original code checks if it raises a UserWarning, please correct me if I am wrong.