MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_globals

Method test_globals

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

Source from the content-addressed store, hash-verified

265
266 @unittest.expectedFailure # TODO: RUSTPYTHON
267 def test_globals(self):
268 self.assertTrue(self.spam.lookup("glob").is_global())
269 self.assertFalse(self.spam.lookup("glob").is_declared_global())
270 self.assertTrue(self.spam.lookup("bar").is_global())
271 self.assertTrue(self.spam.lookup("bar").is_declared_global())
272 self.assertFalse(self.internal.lookup("x").is_global())
273 self.assertFalse(self.Mine.lookup("instance_var").is_global())
274 self.assertTrue(self.spam.lookup("bar").is_global())
275 # Module-scope globals are both global and local
276 self.assertTrue(self.top.lookup("some_non_assigned_global_var").is_global())
277 self.assertTrue(self.top.lookup("some_assigned_global_var").is_global())
278
279 @unittest.expectedFailure # TODO: RUSTPYTHON
280 def test_nonlocal(self):

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
assertFalseMethod · 0.80
is_globalMethod · 0.45
lookupMethod · 0.45
is_declared_globalMethod · 0.45

Tested by

no test coverage detected