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

Method test_cwd_with_relative_arg

Lib/test/test_subprocess.py:467–480  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

465
466 @unittest.skipIf(mswindows, "pending resolution of issue #15533")
467 def test_cwd_with_relative_arg(self):
468 # Check that Popen looks for args[0] relative to cwd if args[0]
469 # is relative.
470 python_dir, python_base = self._split_python_path()
471 rel_python = os.path.join(os.curdir, python_base)
472 with os_helper.temp_cwd() as wrong_dir:
473 # Before calling with the correct cwd, confirm that the call fails
474 # without cwd and with the wrong cwd.
475 self.assertRaises(FileNotFoundError, subprocess.Popen,
476 [rel_python])
477 self.assertRaises(FileNotFoundError, subprocess.Popen,
478 [rel_python], cwd=wrong_dir)
479 python_dir = self._normalize_cwd(python_dir)
480 self._assert_cwd(python_dir, rel_python, cwd=python_dir)
481
482 @unittest.skipIf(mswindows, "pending resolution of issue #15533")
483 def test_cwd_with_relative_executable(self):

Callers

nothing calls this directly

Calls 5

_split_python_pathMethod · 0.95
_normalize_cwdMethod · 0.95
_assert_cwdMethod · 0.95
joinMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected