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

Method test_package_recursion

Lib/test/test_cmd_line_script.py:369–378  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

367 self._check_import_error(["-m", "test_pkg"], msg, cwd=script_dir)
368
369 def test_package_recursion(self):
370 with os_helper.temp_dir() as script_dir:
371 pkg_dir = os.path.join(script_dir, 'test_pkg')
372 make_pkg(pkg_dir)
373 main_dir = os.path.join(pkg_dir, '__main__')
374 make_pkg(main_dir)
375 msg = ("Cannot use package as __main__ module; "
376 "'test_pkg' is a package and cannot "
377 "be directly executed")
378 self._check_import_error(["-m", "test_pkg"], msg, cwd=script_dir)
379
380 def test_issue8202(self):
381 # Make sure package __init__ modules see "-m" in sys.argv0 while

Callers

nothing calls this directly

Calls 4

_check_import_errorMethod · 0.95
make_pkgFunction · 0.90
temp_dirMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected