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

Method test_import

Lib/test/_test_multiprocessing.py:5197–5217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5195 return modules
5196
5197 def test_import(self):
5198 modules = self.get_module_names()
5199 if sys.platform == 'win32':
5200 modules.remove('multiprocessing.popen_fork')
5201 modules.remove('multiprocessing.popen_forkserver')
5202 modules.remove('multiprocessing.popen_spawn_posix')
5203 else:
5204 modules.remove('multiprocessing.popen_spawn_win32')
5205 if not HAS_REDUCTION:
5206 modules.remove('multiprocessing.popen_forkserver')
5207
5208 if c_int is None:
5209 # This module requires _ctypes
5210 modules.remove('multiprocessing.sharedctypes')
5211
5212 for name in modules:
5213 __import__(name)
5214 mod = sys.modules[name]
5215 self.assertHasAttr(mod, '__all__', name)
5216 for attr in mod.__all__:
5217 self.assertHasAttr(mod, attr)
5218
5219#
5220# Quick test that logging works -- does not test logging output

Callers

nothing calls this directly

Calls 4

get_module_namesMethod · 0.95
__import__Function · 0.85
assertHasAttrMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected