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

Method test_submodule_imported_warning

Lib/test/test_runpy.py:485–493  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

483 self.fail("Nothing raised; expected {}".format(name))
484
485 def test_submodule_imported_warning(self):
486 pkg_dir, _, mod_name, _ = self._make_pkg("", 1)
487 try:
488 __import__(mod_name)
489 with self.assertWarnsRegex(RuntimeWarning,
490 r"found in sys\.modules"):
491 run_module(mod_name)
492 finally:
493 self._del_pkg(pkg_dir)
494
495 def test_package_imported_no_warning(self):
496 pkg_dir, _, mod_name, _ = self._make_pkg("", 1, "__main__")

Callers

nothing calls this directly

Calls 5

_make_pkgMethod · 0.95
_del_pkgMethod · 0.95
run_moduleFunction · 0.90
__import__Function · 0.85
assertWarnsRegexMethod · 0.80

Tested by

no test coverage detected