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

Method test_local

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

Source from the content-addressed store, hash-verified

276 self.assertEqual(self.other_internal.get_nonlocals(), expected)
277
278 def test_local(self):
279 self.assertTrue(self.spam.lookup("x").is_local())
280 self.assertFalse(self.spam.lookup("bar").is_local())
281 # Module-scope globals are both global and local
282 self.assertTrue(self.top.lookup("some_non_assigned_global_var").is_local())
283 self.assertTrue(self.top.lookup("some_assigned_global_var").is_local())
284
285 def test_free(self):
286 self.assertTrue(self.internal.lookup("x").is_free())

Callers

nothing calls this directly

Calls 4

assertTrueMethod · 0.80
is_localMethod · 0.80
assertFalseMethod · 0.80
lookupMethod · 0.45

Tested by

no test coverage detected