From: Benjamin Peterson Date: Fri, 24 Oct 2008 22:16:39 +0000 (+0000) Subject: add grammar tests for nonlocal X-Git-Tag: v3.0rc2~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a933e520e8c86901630186be1eb50d4faafade0e;p=python add grammar tests for nonlocal --- diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 9a8846307e..eadf1db7ab 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