diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2010-08-19 21:35:59 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2010-08-19 21:35:59 (GMT) |
commit | a1e5c69d5bc50b57ac10a27c77a6016947919abd (patch) | |
tree | 83518d23fee5d459fa2fcfd8d75a5061355bd605 /Lib/test/test_syntax.py | |
parent | fc34ac5fdd8633179c1438ee9ef32a018d76e658 (diff) | |
download | cpython-a1e5c69d5bc50b57ac10a27c77a6016947919abd.zip cpython-a1e5c69d5bc50b57ac10a27c77a6016947919abd.tar.gz cpython-a1e5c69d5bc50b57ac10a27c77a6016947919abd.tar.bz2 |
Merged revisions 84214 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84214 | amaury.forgeotdarc | 2010-08-19 23:32:38 +0200 (jeu., 19 août 2010) | 3 lines
Add tests for r84209 (crashes in the Ast builder)
Also remove one tab, and move a check closer to the possible failure.
........
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index c55171a..be783c7 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -476,6 +476,34 @@ Traceback (most recent call last): ... SyntaxError: keyword argument repeated +Corner-cases that used to fail to raise the correct error: + + >>> def f(*, x=lambda __debug__:0): pass + Traceback (most recent call last): + SyntaxError: assignment to keyword + + >>> def f(*args:(lambda __debug__:0)): pass + Traceback (most recent call last): + SyntaxError: assignment to keyword + + >>> def f(**kwargs:(lambda __debug__:0)): pass + Traceback (most recent call last): + SyntaxError: assignment to keyword + + >>> with (lambda *:0): pass + Traceback (most recent call last): + SyntaxError: named arguments must follow bare * + +Corner-cases that used to crash: + + >>> def f(**__debug__): pass + Traceback (most recent call last): + SyntaxError: assignment to keyword + + >>> def f(*xx, __debug__): pass + Traceback (most recent call last): + SyntaxError: assignment to keyword + """ import re |