summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_symtable.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-06 16:05:57 (GMT)
committerGitHub <noreply@github.com>2020-04-06 16:05:57 (GMT)
commit799d7d61a91eb0ad3256ef9a45a90029cef93b7c (patch)
treef682be5556bd71eb9d95f12abf618e1d386f8be5 /Lib/test/test_symtable.py
parent38aefc585f60a77d66f4fbe5a37594a488b53474 (diff)
downloadcpython-799d7d61a91eb0ad3256ef9a45a90029cef93b7c.zip
cpython-799d7d61a91eb0ad3256ef9a45a90029cef93b7c.tar.gz
cpython-799d7d61a91eb0ad3256ef9a45a90029cef93b7c.tar.bz2
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391)
Diffstat (limited to 'Lib/test/test_symtable.py')
-rw-r--r--Lib/test/test_symtable.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index bea2ce1..98d718c 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -99,6 +99,7 @@ class SymtableTest(unittest.TestCase):
self.assertTrue(self.spam.lookup("bar").is_declared_global())
self.assertFalse(self.internal.lookup("x").is_global())
self.assertFalse(self.Mine.lookup("instance_var").is_global())
+ self.assertTrue(self.spam.lookup("bar").is_global())
def test_nonlocal(self):
self.assertFalse(self.spam.lookup("some_var").is_nonlocal())
@@ -108,7 +109,10 @@ class SymtableTest(unittest.TestCase):
def test_local(self):
self.assertTrue(self.spam.lookup("x").is_local())
- self.assertFalse(self.internal.lookup("x").is_local())
+ self.assertFalse(self.spam.lookup("bar").is_local())
+
+ def test_free(self):
+ self.assertTrue(self.internal.lookup("x").is_free())
def test_referenced(self):
self.assertTrue(self.internal.lookup("x").is_referenced())