(self)
| 499 | cwd=python_dir) |
| 500 | |
| 501 | def test_cwd_with_absolute_arg(self): |
| 502 | # Check that Popen can find the executable when the cwd is wrong |
| 503 | # if args[0] is an absolute path. |
| 504 | python_dir, python_base = self._split_python_path() |
| 505 | abs_python = os.path.join(python_dir, python_base) |
| 506 | rel_python = os.path.join(os.curdir, python_base) |
| 507 | with os_helper.temp_dir() as wrong_dir: |
| 508 | # Before calling with an absolute path, confirm that using a |
| 509 | # relative path fails. |
| 510 | self.assertRaises(FileNotFoundError, subprocess.Popen, |
| 511 | [rel_python], cwd=wrong_dir) |
| 512 | wrong_dir = self._normalize_cwd(wrong_dir) |
| 513 | self._assert_cwd(wrong_dir, abs_python, cwd=wrong_dir) |
| 514 | |
| 515 | @unittest.skipIf(sys.base_prefix != sys.prefix, |
| 516 | 'Test is not venv-compatible') |
nothing calls this directly
no test coverage detected