summaryrefslogtreecommitdiff
path: root/pylint/test/functional/undefined_loop_variable.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/test/functional/undefined_loop_variable.py')
-rw-r--r--pylint/test/functional/undefined_loop_variable.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/pylint/test/functional/undefined_loop_variable.py b/pylint/test/functional/undefined_loop_variable.py
index 6c28a4088..3840003b5 100644
--- a/pylint/test/functional/undefined_loop_variable.py
+++ b/pylint/test/functional/undefined_loop_variable.py
@@ -35,3 +35,27 @@ for x in []:
pass
for x in range(3):
VAR5 = (lambda: x)()
+
+
+def do_stuff_with_a_list():
+ for var in [1, 2, 3]:
+ pass
+ return var
+
+
+def do_stuff_with_a_set():
+ for var in {1, 2, 3}:
+ pass
+ return var
+
+
+def do_stuff_with_a_dict():
+ for var in {1: 2, 3: 4}:
+ pass
+ return var
+
+
+def do_stuff_with_a_tuple():
+ for var in (1, 2, 3):
+ pass
+ return var