aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-09-06 18:23:49 +0200
committerGitHub <noreply@github.com>2021-09-06 18:23:49 +0200
commit97f7933d9838853cfff901db37545b9b8478296e (patch)
tree1e286ad674ee7f00267c59b7f1e9db9638bb4bc4
parent130dd1b3eed3937ed60849c0dab988a36d828c73 (diff)
downloadpylint-97f7933d9838853cfff901db37545b9b8478296e.tar.gz
Add additional test case - consider-using-assignment-expr (#4975)
-rw-r--r--tests/functional/ext/code_style/code_style_consider_using_assignment_expr.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/functional/ext/code_style/code_style_consider_using_assignment_expr.py b/tests/functional/ext/code_style/code_style_consider_using_assignment_expr.py
index 07b51ce10..60d3f4d1b 100644
--- a/tests/functional/ext/code_style/code_style_consider_using_assignment_expr.py
+++ b/tests/functional/ext/code_style/code_style_consider_using_assignment_expr.py
@@ -1,4 +1,4 @@
-# pylint: disable=missing-docstring,invalid-name,undefined-variable
+# pylint: disable=missing-docstring,invalid-name,undefined-variable,too-few-public-methods
a1 = 2
if a1: # [consider-using-assignment-expr]
@@ -146,3 +146,14 @@ def func_p():
...
elif p6_other:
...
+
+
+# -----
+# Assignment expression does NOT work for attribute access
+# Make sure not to emit message!
+class A:
+ var = 1
+
+A.var = 2
+if A.var:
+ ...