summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-10-24 22:16:39 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-10-24 22:16:39 (GMT)
commita933e520e8c86901630186be1eb50d4faafade0e (patch)
tree3a28219f3fd6357e0deea5489cb0a9712717ec19 /Lib
parentd03928614f20e29d3f9a934e2c85bc09c8df3ae8 (diff)
downloadcpython-a933e520e8c86901630186be1eb50d4faafade0e.zip
cpython-a933e520e8c86901630186be1eb50d4faafade0e.tar.gz
cpython-a933e520e8c86901630186be1eb50d4faafade0e.tar.bz2
add grammar tests for nonlocal
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_grammar.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 9a88463..eadf1db 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -485,6 +485,14 @@ class GrammarTests(unittest.TestCase):
global a, b
global one, two, three, four, five, six, seven, eight, nine, ten
+ def testNonlocal(self):
+ # 'nonlocal' NAME (',' NAME)*
+ x = 0
+ y = 0
+ def f():
+ nonlocal x
+ nonlocal x, y
+
def testAssert(self):
# assert_stmt: 'assert' test [',' test]
assert 1