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

Method test_e2e

Lib/test/test_importlib/test_lazy.py:85–96  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

83 return module
84
85 def test_e2e(self):
86 # End-to-end test to verify the load is in fact lazy.
87 importer = TestingImporter()
88 assert importer.loaded is None
89 with test_util.uncache(importer.module_name):
90 with test_util.import_state(meta_path=[importer]):
91 module = importlib.import_module(importer.module_name)
92 self.assertIsNone(importer.loaded)
93 # Trigger load.
94 self.assertEqual(module.__loader__, importer)
95 self.assertIsNotNone(importer.loaded)
96 self.assertEqual(module, importer.loaded)
97
98 def test_attr_unchanged(self):
99 # An attribute only mutated as a side-effect of import should not be

Callers

nothing calls this directly

Calls 5

TestingImporterClass · 0.85
assertIsNoneMethod · 0.80
assertIsNotNoneMethod · 0.80
import_moduleMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected