Add tests for syntax errors.

This commit is contained in:
Raymond Hettinger 2004-09-30 22:29:03 +00:00
parent 0fe00aafc3
commit 7b46f6b2a5

View file

@ -120,6 +120,19 @@
>>> max(tupleids) - min(tupleids)
0
Verify that syntax error's are raised for genexps used as lvalues
>>> (y for y in (1,2)) = 10
Traceback (most recent call last):
...
SyntaxError: assign to generator expression not possible
>>> (y for y in (1,2)) += 10
Traceback (most recent call last):
...
SyntaxError: augmented assign to tuple literal or generator expression not possible
########### Tests borrowed from or inspired by test_generators.py ############