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

Method test_reload_submodule

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

Source from the content-addressed store, hash-verified

327 self.assertEqual(ns, expected)
328
329 def test_reload_submodule(self):
330 # See #19851.
331 name = 'spam'
332 subname = 'ham'
333 with test_util.temp_module(name, pkg=True) as pkg_dir:
334 fullname, _ = test_util.submodule(name, subname, pkg_dir)
335 ham = self.init.import_module(fullname)
336 reloaded = self.init.reload(ham)
337 self.assertIs(reloaded, ham)
338
339 def test_module_missing_spec(self):
340 #Test that reload() throws ModuleNotFounderror when reloading

Callers

nothing calls this directly

Calls 3

import_moduleMethod · 0.45
reloadMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected