Issue #14696: Merge from 3.2

This commit is contained in:
Mark Dickinson 2012-04-29 22:20:01 +01:00
commit 57404891a0
3 changed files with 48 additions and 5 deletions

View file

@ -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]")