diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-04-06 16:41:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 16:41:55 (GMT) |
commit | 8bd84e7f79a6cc7670a89a92edba3015aa781758 (patch) | |
tree | a008c2e1039b3f18ac0ea9f7ce85466fa9325d4e /Lib/test | |
parent | f7b0259d0d243a71d79a3fda9ec7aad4306513eb (diff) | |
download | cpython-8bd84e7f79a6cc7670a89a92edba3015aa781758.zip cpython-8bd84e7f79a6cc7670a89a92edba3015aa781758.tar.gz cpython-8bd84e7f79a6cc7670a89a92edba3015aa781758.tar.bz2 |
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (GH-19394)
(cherry picked from commit 799d7d61a91eb0ad3256ef9a45a90029cef93b7c)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_symtable.py | 6 |
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()) |