summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index ce719018cf..5f2528b904 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -970,12 +970,22 @@ Incomplete dictionary literals
Traceback (most recent call last):
SyntaxError: expression expected after dictionary key and ':'
- # Ensure that the error is not raise for syntax errors that happen after sets
+ # Ensure that the error is not raised for syntax errors that happen after sets
>>> {1} $
Traceback (most recent call last):
SyntaxError: invalid syntax
+ # Ensure that the error is not raised for invalid expressions
+
+ >>> {1: 2, 3: foo(,), 4: 5}
+ Traceback (most recent call last):
+ SyntaxError: invalid syntax
+
+ >>> {1: $, 2: 3}
+ Traceback (most recent call last):
+ SyntaxError: invalid syntax
+
Specialized indentation errors:
>>> while condition:
@@ -1508,8 +1518,8 @@ def fib(n):
self.assertEqual(compile(s1, '<string>', 'exec'), compile(s2, '<string>', 'exec'))
except SyntaxError:
self.fail("Indented statement over multiple lines is valid")
-
- def test_continuation_bad_indentation(self):
+
+ def test_continuation_bad_indentation(self):
# Check that code that breaks indentation across multiple lines raises a syntax error
code = r"""\