aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test
diff options
context:
space:
mode:
authorBatuhan Taskaya <batuhan@python.org>2021-07-18 15:56:09 +0300
committerGitHub <noreply@github.com>2021-07-18 15:56:09 +0300
commita045991f60b51636a784623dda7ad84b5b2c6b73 (patch)
tree3b778d4c70034327e1066aee0060638d93ce11ad /Lib/test
parent8f50f44592190b5a8cb115f0d58d577036e68308 (diff)
downloadcpython-a045991f60b51636a784623dda7ad84b5b2c6b73.tar.gz
cpython-a045991f60b51636a784623dda7ad84b5b2c6b73.zip
bpo-42355: symtable.get_namespace() now checks whether there are multiple or any namespaces found (GH-23278)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_symtable.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index a30e5349603..819354e4eee 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -159,6 +159,10 @@ class SymtableTest(unittest.TestCase):
self.assertEqual(len(ns_test.get_namespaces()), 2)
self.assertRaises(ValueError, ns_test.get_namespace)
+ ns_test_2 = self.top.lookup("glob")
+ self.assertEqual(len(ns_test_2.get_namespaces()), 0)
+ self.assertRaises(ValueError, ns_test_2.get_namespace)
+
def test_assigned(self):
self.assertTrue(self.spam.lookup("x").is_assigned())
self.assertTrue(self.spam.lookup("bar").is_assigned())