Skip to content

Commit

Permalink
Add a regression test for undefined-loop-variable false positive
Browse files Browse the repository at this point in the history
Regression tests for #3711
Require pylint-dev/astroid#1102 to be merged.
  • Loading branch information
Pierre-Sassoulas committed Jul 19, 2021
1 parent 5305c76 commit 4357e82
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/functional/u/undefined/undefined_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,18 @@ def undefined_annotation(a:x): # [undefined-variable]
for x in [1, 2]:
pass
return a


# #3711's comment regression test
lst = []
lst2 = [1, 2, 3]

for item in lst:
pass

bigger = [
[
x for x in lst2 if x > item
]
for item in lst
]

0 comments on commit 4357e82

Please sign in to comment.