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

Method test_cleared_globals

Lib/test/test_import/__init__.py:2971–2982  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2969 # the tests
2970
2971 def test_cleared_globals(self):
2972 loaded = self.load(self.NAME)
2973 _testsinglephase = loaded.module
2974 init_before = _testsinglephase.state_initialized()
2975
2976 _testsinglephase._clear_globals()
2977 init_after = _testsinglephase.state_initialized()
2978 init_count = _testsinglephase.initialized_count()
2979
2980 self.assertGreater(init_before, 0)
2981 self.assertEqual(init_after, 0)
2982 self.assertEqual(init_count, -1)
2983
2984 def test_variants(self):
2985 # Exercise the most meaningful variants described in Python/import.c.

Callers

nothing calls this directly

Calls 3

loadMethod · 0.95
assertGreaterMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected