diff options
author | Sayan Chowdhury <sayan.chowdhury2012@gmail.com> | 2017-02-26 22:36:10 +0530 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2017-02-26 20:06:10 +0300 |
commit | d5c11f7ace48701bb950c6345deee88c35c66e26 (patch) | |
tree | d9bc96e3eac6e73e71ace58da749eaa49f17d91e /Lib | |
parent | 6b4a5f45e2df524174a97832571c82c76a3d424a (diff) | |
download | cpython-git-d5c11f7ace48701bb950c6345deee88c35c66e26.tar.gz |
bpo-28624: Add a test that checks that cwd parameter of Popen() accepts PathLike objects (#157)
Diffstat (limited to 'Lib')
-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 812e7bf2cc..8511207f0d 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] |