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.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/pyflakes/test/test_other.py b/pyflakes/test/test_other.py
index 282accb..7a02468 100644
--- a/pyflakes/test/test_other.py
+++ b/pyflakes/test/test_other.py
@@ -1433,6 +1433,29 @@ class TestUnusedAssignment(TestCase):
self.flakes("a = foo if True else 'oink'", m.UndefinedName)
self.flakes("a = 'moo' if True else bar", m.UndefinedName)
+ def test_if_tuple(self):
+ """
+ Test C{if (foo,)} conditions.
+ """
+ self.flakes("""if (): pass""")
+ self.flakes("""
+ if (
+ True
+ ):
+ pass
+ """)
+ self.flakes("""
+ if (
+ True,
+ ):
+ pass
+ """, m.IfTuple)
+ self.flakes("""
+ x = 1 if (
+ True,
+ ) else 2
+ """, m.IfTuple)
+
def test_withStatementNoNames(self):
"""
No warnings are emitted for using inside or after a nameless C{with}