mirror of
https://github.com/python/cpython.git
synced 2025-10-05 06:31:48 +00:00
bpo-32964: Reuse a testing implementation of the path protocol in tests. (GH-5930)
(cherry picked from commit b21d155f57
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
0e06be836c
commit
a13b65422a
11 changed files with 70 additions and 103 deletions
|
@ -17,6 +17,7 @@ import shutil
|
|||
import threading
|
||||
import gc
|
||||
import textwrap
|
||||
from test.support import FakePath
|
||||
|
||||
try:
|
||||
import ctypes
|
||||
|
@ -359,12 +360,7 @@ class ProcessTestCase(BaseTestCase):
|
|||
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())
|
||||
self._assert_cwd(temp_dir, sys.executable, cwd=FakePath(temp_dir))
|
||||
|
||||
@unittest.skipIf(mswindows, "pending resolution of issue #15533")
|
||||
def test_cwd_with_relative_arg(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue