[Python-checkins] python/dist/src/Lib/test test_compile.py,
1.10.10.2, 1.10.10.3
jhylton at users.sourceforge.net
jhylton at users.sourceforge.net
Fri Apr 23 00:35:59 EDT 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14493/test
Modified Files:
Tag: ast-branch
test_compile.py
Log Message:
Enable the two previously-failing tests. Remove the output file.
Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.10.10.2
retrieving revision 1.10.10.3
diff -C2 -d -r1.10.10.2 -r1.10.10.3
*** test_compile.py 23 Apr 2004 04:14:07 -0000 1.10.10.2
--- test_compile.py 23 Apr 2004 04:35:57 -0000 1.10.10.3
***************
*** 46,49 ****
--- 46,65 ----
SyntaxError: duplicate argument 'a' in function definition (<string>, line 1)
+ >>> def f(a):
+ ... global a
+ ... a = 1
+ Traceback (most recent call last):
+ ...
+ SyntaxError: name 'a' is local and global
+
+ XXX How hard would it be to get the location in the error?
+
+ >>> def f(a=1, (b, c)):
+ ... pass
+ Traceback (most recent call last):
+ ...
+ SyntaxError: non-default argument follows default argument (<string>, line 1)
+
+
Details of SyntaxError object
-----------------------------
***************
*** 95,110 ****
from test.test_support import verbose, TestFailed, run_doctest
- ##try:
- ## exec 'def f(a): global a; a = 1'
- ## raise TestFailed, "variable is global and local"
- ##except SyntaxError:
- ## pass
-
- ##try:
- ## exec 'def f(a=1, (b, c)): pass'
- ## raise TestFailed, "non-default args after default"
- ##except SyntaxError:
- ## pass
-
# It takes less space to deal with bad float literals using a helper
# function than it does with doctest. The doctest needs to include
--- 111,114 ----
More information about the Python-checkins
mailing list