-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Prevent applying boolean ops to NotImplemented
#1702
Prevent applying boolean ops to NotImplemented
#1702
Conversation
Pull Request Test Coverage Report for Build 2645011504
💛 - Coveralls |
@@ -1117,6 +1117,12 @@ def __radd__(self, other): return NotImplemented | |||
first = next(ast_node.infer()) | |||
self.assertEqual(first, util.Uninferable) | |||
|
|||
@pytest.mark.filterwarnings("error::DeprecationWarning") |
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.
Do we need to filter that ? I thought the fix was precisely to remove the deprecation warning ?
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.
Good Q, "filter" is a little misleading here. It's taking DeprecationWarning and raising it to error
. Revert the fix and this test will fail.
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.
Otherwise the test would pass anyway, since pytest
doesn't fail tests when there are deprecationwarnings.
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.
We might as well change the global configuration, we often have to so "fix deprecation warning" merge request both for astroid and pylint.
Steps
Description
Prevents this DeprecationWarning:
DeprecationWarning: NotImplemented should not be used in a boolean context
Reproducer:
python -Werror -m pylint ipaddress
Type of Changes