[Python-checkins] CVS: python/dist/src/Lib/test test_grammar.py,1.33,1.34 test_global.py,1.3,1.4

Jeremy Hylton jhylton@users.sourceforge.net
Wed, 28 Feb 2001 15:49:21 -0800


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

Modified Files:
	test_grammar.py test_global.py 
Log Message:
Add test case for global stmt at module level.
Fix test_grammar so that it ignores warning about global stmt at
module level in exec. 


Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** test_grammar.py	2001/02/19 15:54:52	1.33
--- test_grammar.py	2001/02/28 23:49:19	1.34
***************
*** 412,415 ****
--- 412,418 ----
  g = {}
  l = {}
+ 
+ import warnings
+ warnings.filterwarnings("ignore", "global statement", module="<string>")
  exec 'global a; a = 1; b = 2' in g, l
  if g.has_key('__builtins__'): del g['__builtins__']

Index: test_global.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_global.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_global.py	2001/02/28 22:50:15	1.3
--- test_global.py	2001/02/28 23:49:19	1.4
***************
*** 38,39 ****
--- 38,45 ----
  """
  compile_and_catch_warning(prog_text_3)
+ 
+ prog_text_4 = """
+ global x
+ x = 2
+ """
+ compile_and_catch_warning(prog_text_4)