summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-10-10 10:15:21 +0000
committerMartin Panter <vadmium+py@gmail.com>2015-10-10 10:15:21 +0000
commitb4c49a7b40ae96dbdc079b40b6c317bd2cbdeb55 (patch)
tree450aeb71ba9d9118732554bb4a7a4a22edc3734d /Lib/test/test_syntax.py
parente013b9445b6f9caab1eb30b7785e3690d1bab4df (diff)
parentb98a5f90775e5f59662e452b3b31e0c07efa3d2c (diff)
downloadcpython-b4c49a7b40ae96dbdc079b40b6c317bd2cbdeb55.tar.gz
Issue #22413: Merge StringIO doc from 3.4 into 3.5
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index a9d3628819..a22cebb828 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -141,6 +141,9 @@ From ast_for_call():
>>> f(x for x in L, 1)
Traceback (most recent call last):
SyntaxError: Generator expression must be parenthesized if not sole argument
+>>> f(x for x in L, y for y in L)
+Traceback (most recent call last):
+SyntaxError: Generator expression must be parenthesized if not sole argument
>>> f((x for x in L), 1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
@@ -582,7 +585,18 @@ class SyntaxTestCase(unittest.TestCase):
subclass=IndentationError)
def test_kwargs_last(self):
- self._check_error("int(base=10, '2')", "non-keyword arg")
+ self._check_error("int(base=10, '2')",
+ "positional argument follows keyword argument")
+
+ def test_kwargs_last2(self):
+ self._check_error("int(**{base: 10}, '2')",
+ "positional argument follows "
+ "keyword argument unpacking")
+
+ def test_kwargs_last3(self):
+ self._check_error("int(**{base: 10}, *['2'])",
+ "iterable argument unpacking follows "
+ "keyword argument unpacking")
def test_main():
support.run_unittest(SyntaxTestCase)