diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-16 10:25:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 10:25:10 +0300 |
commit | 0152dc4ff5534fa2948b95262e70ff6b202b9b99 (patch) | |
tree | cf311cb487a6f1956ab942d6356e5b5698659f85 /Lib/test/test_subprocess.py | |
parent | 0142a2292c3d3bfa56a987d576a9678be0f56931 (diff) | |
download | cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.tar.gz cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.zip |
gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 9ecd8426cb5..8b69cd03ba7 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -25,7 +25,6 @@ import threading import gc import textwrap import json -import pathlib from test.support.os_helper import FakePath try: @@ -1522,9 +1521,6 @@ class ProcessTestCase(BaseTestCase): p.communicate(b"x" * 2**20) def test_repr(self): - path_cmd = pathlib.Path("my-tool.py") - pathlib_cls = path_cmd.__class__.__name__ - cases = [ ("ls", True, 123, "<Popen: returncode: 123 args: 'ls'>"), ('a' * 100, True, 0, @@ -1532,7 +1528,8 @@ class ProcessTestCase(BaseTestCase): (["ls"], False, None, "<Popen: returncode: None args: ['ls']>"), (["ls", '--my-opts', 'a' * 100], False, None, "<Popen: returncode: None args: ['ls', '--my-opts', 'aaaaaaaaaaaaaaaaaaaaaaaa...>"), - (path_cmd, False, 7, f"<Popen: returncode: 7 args: {pathlib_cls}('my-tool.py')>") + (os_helper.FakePath("my-tool.py"), False, 7, + "<Popen: returncode: 7 args: <FakePath 'my-tool.py'>>") ] with unittest.mock.patch.object(subprocess.Popen, '_execute_child'): for cmd, shell, code, sx in cases: |