diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-02-26 17:38:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-26 17:38:31 (GMT) |
commit | 6b81003bdbd9375886bae54f876650bcdccfe6c7 (patch) | |
tree | 51c876f85b1b5d76d251bb2f93da6759e8395b9e /Lib/test/test_subprocess.py | |
parent | deea29e61e61f0e216bff3f0ca008f5ee231793f (diff) | |
download | cpython-6b81003bdbd9375886bae54f876650bcdccfe6c7.zip cpython-6b81003bdbd9375886bae54f876650bcdccfe6c7.tar.gz cpython-6b81003bdbd9375886bae54f876650bcdccfe6c7.tar.bz2 |
bpo-28624: Add a test that checks that cwd parameter of Popen() accepts PathLike objects (#157) (#323)
(cherry picked from commit d5c11f7ace48701bb950c6345deee88c35c66e26)
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index e63f9f2..3c871dd 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -347,6 +347,16 @@ class ProcessTestCase(BaseTestCase): temp_dir = self._normalize_cwd(temp_dir) self._assert_cwd(temp_dir, sys.executable, cwd=temp_dir) + def test_cwd_with_pathlike(self): + temp_dir = tempfile.gettempdir() + temp_dir = self._normalize_cwd(temp_dir) + + class _PathLikeObj: + def __fspath__(self): + return temp_dir + + self._assert_cwd(temp_dir, sys.executable, cwd=_PathLikeObj()) + @unittest.skipIf(mswindows, "pending resolution of issue #15533") def test_cwd_with_relative_arg(self): # Check that Popen looks for args[0] relative to cwd if args[0] |