Add test for nonlocal

This commit is contained in:
HyeockJinKim
2019-09-12 01:14:14 +09:00
parent 7695851cde
commit f8cb4a5690

View File

@@ -56,6 +56,14 @@ c = 2
with assertRaises(SyntaxError):
exec(src)
# Invalid syntax:
src = """
def a():
nonlocal a
"""
with assertRaises(SyntaxError):
exec(src)
# class X:
# nonlocal c