summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-28 23:49:19 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-28 23:49:19 (GMT)
commit2922ea8235c183cb35c3415b5888967af55812fa (patch)
tree42e315ecc3ff6956756ccbaff13a9b0dfebabe47 /Lib/test/test_grammar.py
parent3dd5ad3b4f1e7be153d272a2ac3848028a6c306b (diff)
downloadcpython-2922ea8235c183cb35c3415b5888967af55812fa.zip
cpython-2922ea8235c183cb35c3415b5888967af55812fa.tar.gz
cpython-2922ea8235c183cb35c3415b5888967af55812fa.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 587d7ec..75a55b9 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -411,6 +411,9 @@ if g.has_key('__builtins__'): del g['__builtins__']
if g != {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
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__']
if l.has_key('__builtins__'): del l['__builtins__']