diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-07-10 11:24:16 -0400 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-07-12 10:14:18 +0200 |
| commit | 153ca73f09f0699e2773864e6f5be50ce4031d21 (patch) | |
| tree | f1b50a1417cd66128753138a496c0714fb9a047e /tests | |
| parent | 875d42e947cdd42adf9745eafaadb5cb8c407bb5 (diff) | |
| download | astroid-git-153ca73f09f0699e2773864e6f5be50ce4031d21.tar.gz | |
Prevent applying boolean ops to `NotImplemented` (#1702)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unittest_inference.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py index 40364345..8673cdfc 100644 --- a/tests/unittest_inference.py +++ b/tests/unittest_inference.py @@ -1117,6 +1117,12 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase): first = next(ast_node.infer()) self.assertEqual(first, util.Uninferable) + @pytest.mark.filterwarnings("error::DeprecationWarning") + def test_binary_op_not_used_in_boolean_context(self) -> None: + ast_node = extract_node("not NotImplemented") + first = next(ast_node.infer()) + self.assertIsInstance(first, nodes.Const) + def test_binary_op_list_mul(self) -> None: for code in ("a = [[]] * 2", "a = 2 * [[]]"): ast = builder.string_build(code, __name__, __file__) |
