diff options
Diffstat (limited to 'tests/functional/nonlocal_and_global.py')
-rw-r--r-- | tests/functional/nonlocal_and_global.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/functional/nonlocal_and_global.py b/tests/functional/nonlocal_and_global.py new file mode 100644 index 000000000..940052436 --- /dev/null +++ b/tests/functional/nonlocal_and_global.py @@ -0,0 +1,12 @@ +"""Test that a name is both nonlocal and global in the same scope."""
+# pylint: disable=missing-docstring,global-variable-not-assigned,invalid-name,nonlocal-without-binding
+
+def bad(): # [nonlocal-and-global]
+ nonlocal missing
+ global missing
+
+def good():
+ nonlocal missing
+ def test():
+ global missing
+ return test
|