[Python-checkins] python/dist/src/Lib/test test_genexps.py,1.6,1.7

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Oct 1 00:29:06 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9044

Modified Files:
	test_genexps.py 
Log Message:
Add tests for syntax errors.



Index: test_genexps.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_genexps.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- test_genexps.py	30 Sep 2004 07:47:20 -0000	1.6
+++ test_genexps.py	30 Sep 2004 22:29:03 -0000	1.7
@@ -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 ############
 



More information about the Python-checkins mailing list