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

Method test_everyone_has___spec__

Lib/test/test_importlib/test_api.py:432–440  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

430 self.assertIsNot(module.__loader__, None)
431
432 def test_everyone_has___spec__(self):
433 for name, module in sys.modules.items():
434 if isinstance(module, types.ModuleType):
435 with self.subTest(name=name):
436 self.assertHasAttr(module, '__spec__')
437 if self.machinery.BuiltinImporter.find_spec(name):
438 self.assertIsNot(module.__spec__, None)
439 elif self.machinery.FrozenImporter.find_spec(name):
440 self.assertIsNot(module.__spec__, None)
441
442
443(Frozen_StartupTests,

Callers

nothing calls this directly

Calls 5

subTestMethod · 0.95
assertHasAttrMethod · 0.80
assertIsNotMethod · 0.80
itemsMethod · 0.45
find_specMethod · 0.45

Tested by

no test coverage detected