(self)
| 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 |
| 382 | # searching for the module to execute |
| 383 | with os_helper.temp_dir() as script_dir: |
| 384 | with os_helper.change_cwd(path=script_dir): |
| 385 | pkg_dir = os.path.join(script_dir, 'test_pkg') |
| 386 | make_pkg(pkg_dir, "import sys; print('init_argv0==%r' % sys.argv[0])") |
| 387 | script_name = _make_test_script(pkg_dir, 'script') |
| 388 | rc, out, err = assert_python_ok('-m', 'test_pkg.script', *example_args, __isolated=False) |
| 389 | if verbose > 1: |
| 390 | print(repr(out)) |
| 391 | expected = "init_argv0==%r" % '-m' |
| 392 | self.assertIn(expected.encode('utf-8'), out) |
| 393 | self._check_output(script_name, rc, out, |
| 394 | script_name, script_name, script_dir, 'test_pkg', |
| 395 | importlib.machinery.SourceFileLoader) |
| 396 | |
| 397 | def test_issue8202_dash_c_file_ignored(self): |
| 398 | # Make sure a "-c" file in the current directory |
nothing calls this directly
no test coverage detected