summaryrefslogtreecommitdiff
path: root/pyflakes/test/test_is_literal.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyflakes/test/test_is_literal.py')
-rw-r--r--pyflakes/test/test_is_literal.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/pyflakes/test/test_is_literal.py b/pyflakes/test/test_is_literal.py
index 9280cda..fbbb205 100644
--- a/pyflakes/test/test_is_literal.py
+++ b/pyflakes/test/test_is_literal.py
@@ -198,3 +198,25 @@ class Test(TestCase):
if 4 < x is 'foo':
pass
""", IsLiteral)
+
+ def test_is_tuple_constant(self):
+ self.flakes('''\
+ x = 5
+ if x is ():
+ pass
+ ''', IsLiteral)
+
+ def test_is_tuple_constant_containing_constants(self):
+ self.flakes('''\
+ x = 5
+ if x is (1, '2', True, (1.5, ())):
+ pass
+ ''', IsLiteral)
+
+ def test_is_tuple_containing_variables_ok(self):
+ # a bit nonsensical, but does not trigger a SyntaxWarning
+ self.flakes('''\
+ x = 5
+ if x is (x,):
+ pass
+ ''')