mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-28624: Add a test that checks that cwd parameter of Popen() accepts PathLike objects (#157)
This commit is contained in:
parent
6b4a5f45e2
commit
d5c11f7ace
4 changed files with 21 additions and 3 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue