summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2012-04-29 21:57:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2012-04-29 21:57:05 (GMT)
commita6df2ee7d084f830f100a5bd563005389d7d20c4 (patch)
treeaa895645c077eef4653abac633cf5e35ec4f306d /Lib/test/test_parser.py
parent9f0ab9f5649b9b6ee54a023e83417f244b4665a0 (diff)
parent57404891a05fe1d5a70fc55ae84e75fe12fc7535 (diff)
downloadcpython-a6df2ee7d084f830f100a5bd563005389d7d20c4.zip
cpython-a6df2ee7d084f830f100a5bd563005389d7d20c4.tar.gz
cpython-a6df2ee7d084f830f100a5bd563005389d7d20c4.tar.bz2
merge
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index d13cf2b..46e7b9e 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -61,6 +61,16 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
" if (yield):\n"
" yield x\n")
+ def test_nonlocal_statement(self):
+ self.check_suite("def f():\n"
+ " x = 0\n"
+ " def g():\n"
+ " nonlocal x\n")
+ self.check_suite("def f():\n"
+ " x = y = 0\n"
+ " def g():\n"
+ " nonlocal x, y\n")
+
def test_expressions(self):
self.check_expr("foo(1)")
self.check_expr("[1, 2, 3]")