summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2021-11-27 10:25:01 -0500
committerGitHub <noreply@github.com>2021-11-27 16:25:01 +0100
commit813aab5069f55eebf501ea000a46fc39a09956a8 (patch)
tree54a68b31e346165c75c9e89b7cf76e288319ccb1 /tests
parent47e860f7d5c73d53de77e7c450535e709e5ef99e (diff)
downloadastroid-git-813aab5069f55eebf501ea000a46fc39a09956a8.tar.gz
Upgrade to pylint 2.12 and enable ``for_any_all`` checker (#1277)
* Enable for_any_all check * Upgrade to pylint 2.12 in pre-commit configuration * Fix new Pylint warnings * Upgrade the regex for Mixin Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unittest_brain.py5
-rw-r--r--tests/unittest_inference.py2
-rw-r--r--tests/unittest_nodes.py4
3 files changed, 4 insertions, 7 deletions
diff --git a/tests/unittest_brain.py b/tests/unittest_brain.py
index f2e15eca..ab009715 100644
--- a/tests/unittest_brain.py
+++ b/tests/unittest_brain.py
@@ -1238,10 +1238,7 @@ def streams_are_fine():
PY3 only
"""
- for stream in (sys.stdout, sys.stderr, sys.stdin):
- if not isinstance(stream, io.IOBase):
- return False
- return True
+ return all(isinstance(s, io.IOBase) for s in (sys.stdout, sys.stderr, sys.stdin))
class IOBrainTest(unittest.TestCase):
diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py
index d6e5e4bf..b18f0925 100644
--- a/tests/unittest_inference.py
+++ b/tests/unittest_inference.py
@@ -6469,7 +6469,7 @@ def test_infer_generated_setter() -> None:
assert isinstance(inferred.args, nodes.Arguments)
# This line used to crash because property generated functions
# did not have args properly set
- assert list(inferred.nodes_of_class(nodes.Const)) == []
+ assert not list(inferred.nodes_of_class(nodes.Const))
def test_infer_list_of_uninferables_does_not_crash() -> None:
diff --git a/tests/unittest_nodes.py b/tests/unittest_nodes.py
index 2b8bad2e..68e2b335 100644
--- a/tests/unittest_nodes.py
+++ b/tests/unittest_nodes.py
@@ -1717,12 +1717,12 @@ class TestPatternMatching:
assert isinstance(case2.pattern, nodes.MatchSingleton)
assert case2.pattern.value is None
- assert list(case2.pattern.get_children()) == []
+ assert not list(case2.pattern.get_children())
assert isinstance(case3.pattern, nodes.MatchAs)
assert case3.pattern.name is None
assert case3.pattern.pattern is None
- assert list(case3.pattern.get_children()) == []
+ assert not list(case3.pattern.get_children())
@staticmethod
def test_match_sequence():