From: Jeremy Hylton Date: Fri, 19 Jan 2001 03:25:56 +0000 (+0000) Subject: add test for SyntaxError on X-Git-Tag: v2.1a1~130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=047e2c93e29ceaa9d321a6e81e6fa9db830173da;p=python add test for SyntaxError on def f(a): global a --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 8905864a91..dff7758038 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1,7 +1,7 @@ from test_support import verbose, TestFailed if verbose: - print 'Running test on duplicate arguments' + print 'Running tests on argument handling' try: exec('def f(a, a): pass') @@ -14,3 +14,9 @@ try: 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