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

Method test_package

Lib/test/test_importlib/frozen/test_finder.py:112–133  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

110 self.check_loader_state(spec, origname, filename)
111
112 def test_package(self):
113 packages = [
114 '__phello__',
115 '__phello__.ham',
116 ]
117 for name in packages:
118 filename = resolve_stdlib_file(name, ispkg=True)
119 with self.subTest(f'{name} -> {name}'):
120 spec = self.find(name)
121 self.check_basic(spec, name, ispkg=True)
122 self.check_loader_state(spec, name, filename)
123 self.check_search_locations(spec)
124 packages = {
125 '__phello_alias__': '__hello__',
126 }
127 for name, origname in packages.items():
128 filename = resolve_stdlib_file(origname, ispkg=False)
129 with self.subTest(f'{name} -> {origname}'):
130 spec = self.find(name)
131 self.check_basic(spec, name, ispkg=True)
132 self.check_loader_state(spec, origname, filename)
133 self.check_search_locations(spec)
134
135 # These are covered by test_module() and test_package().
136 test_module_in_package = None

Callers

nothing calls this directly

Calls 7

findMethod · 0.95
check_basicMethod · 0.95
check_loader_stateMethod · 0.95
resolve_stdlib_fileFunction · 0.70
subTestMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected