MCPcopy Index your code
hub / github.com/python/cpython / test_nonlocal

Method test_nonlocal

Lib/test/test_symtable.py:272–276  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

270 self.assertTrue(self.top.lookup("some_assigned_global_var").is_global())
271
272 def test_nonlocal(self):
273 self.assertFalse(self.spam.lookup("some_var").is_nonlocal())
274 self.assertTrue(self.other_internal.lookup("some_var").is_nonlocal())
275 expected = ("some_var",)
276 self.assertEqual(self.other_internal.get_nonlocals(), expected)
277
278 def test_local(self):
279 self.assertTrue(self.spam.lookup("x").is_local())

Callers

nothing calls this directly

Calls 6

assertFalseMethod · 0.80
is_nonlocalMethod · 0.80
assertTrueMethod · 0.80
get_nonlocalsMethod · 0.80
lookupMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected