[Python-checkins] CVS: python/dist/src/Lib/test test_compile.py,1.3,1.4

Jeremy Hylton jhylton@users.sourceforge.net
Thu, 18 Jan 2001 19:25:58 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv12978

Modified Files:
	test_compile.py 
Log Message:
add test for SyntaxError on
    def f(a):
        global a


Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_compile.py	2001/01/17 21:51:35	1.3
--- test_compile.py	2001/01/19 03:25:56	1.4
***************
*** 2,6 ****
  
  if verbose:
!     print 'Running test on duplicate arguments'
  
  try:
--- 2,6 ----
  
  if verbose:
!     print 'Running tests on argument handling'
  
  try:
***************
*** 13,16 ****
--- 13,22 ----
      exec('def f(a = 0, a = 1): pass')
      raise TestFailed, "duplicate keyword arguments"
+ except SyntaxError:
+     pass
+ 
+ try:
+     exec('def f(a): global a; a = 1')
+     raise TestFailed, "variable is global and local"
  except SyntaxError:
      pass