summaryrefslogtreecommitdiff
path: root/pyflakes/test/test_other.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyflakes/test/test_other.py')
-rw-r--r--pyflakes/test/test_other.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py
index 14f213c..5bae7a0 100644
--- a/pyflakes/test/test_other.py
+++ b/pyflakes/test/test_other.py
@@ -151,6 +151,25 @@ class Test(TestCase):
def a(): pass
''', m.RedefinedWhileUnused)
+ def test_redefinedUnderscoreFunction(self):
+ """
+ Test that shadowing a function definition named with underscore doesn't
+ raise anything.
+ """
+ self.flakes('''
+ def _(): pass
+ def _(): pass
+ ''')
+
+ def test_redefinedUnderscoreImportation(self):
+ """
+ Test that shadowing an underscore importation raises a warning.
+ """
+ self.flakes('''
+ from .i18n import _
+ def _(): pass
+ ''', m.RedefinedWhileUnused)
+
def test_redefinedClassFunction(self):
"""
Test that shadowing a function definition in a class suite with another