summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Bott <52465744+elizabethbott@users.noreply.github.com>2021-04-18 15:05:53 -0400
committerGitHub <noreply@github.com>2021-04-18 21:05:53 +0200
commitecbcb9eccd575b6d1ffd80d49b87e104f786b6ac (patch)
tree62a5e42f5865916e03fa2ffbc10ac9edaaa27d4e
parentb2f0d495bb75f8c7edde474c096f60c3533ec650 (diff)
downloadpylint-git-ecbcb9eccd575b6d1ffd80d49b87e104f786b6ac.tar.gz
Added test case for issue #4163 (#4374)
Co-authored-by: Elizabeth <ebott@umich.edu>
-rw-r--r--tests/functional/r/redefine_loop.py8
-rw-r--r--tests/functional/r/redefine_loop.txt1
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/functional/r/redefine_loop.py b/tests/functional/r/redefine_loop.py
new file mode 100644
index 000000000..012ba136b
--- /dev/null
+++ b/tests/functional/r/redefine_loop.py
@@ -0,0 +1,8 @@
+"""Test case for variable redefined in inner loop."""
+for item in range(0, 5):
+ print("hello")
+ for item in range(5, 10): #[redefined-outer-name]
+ print(item)
+ print("yay")
+ print(item)
+ print("done")
diff --git a/tests/functional/r/redefine_loop.txt b/tests/functional/r/redefine_loop.txt
new file mode 100644
index 000000000..dec738ee8
--- /dev/null
+++ b/tests/functional/r/redefine_loop.txt
@@ -0,0 +1 @@
+redefined-outer-name:4:4::Redefining name 'item' from outer scope (line 2)