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

Method test_init

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

Source from the content-addressed store, hash-verified

24class LazyLoaderFactoryTests(unittest.TestCase):
25
26 def test_init(self):
27 factory = util.LazyLoader.factory(CollectInit)
28 # E.g. what importlib.machinery.FileFinder instantiates loaders with
29 # plus keyword arguments.
30 lazy_loader = factory('module name', 'module path', kw='kw')
31 loader = lazy_loader.loader
32 self.assertEqual(('module name', 'module path'), loader.args)
33 self.assertEqual({'kw': 'kw'}, loader.kwargs)
34
35 def test_validation(self):
36 # No exec_module(), no lazy loading.

Callers

nothing calls this directly

Calls 3

factoryFunction · 0.50
factoryMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected