diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-16 07:25:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 07:25:10 (GMT) |
commit | 0152dc4ff5534fa2948b95262e70ff6b202b9b99 (patch) | |
tree | cf311cb487a6f1956ab942d6356e5b5698659f85 /Lib/test/test_runpy.py | |
parent | 0142a2292c3d3bfa56a987d576a9678be0f56931 (diff) | |
download | cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.zip cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.tar.gz cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.tar.bz2 |
gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)
Diffstat (limited to 'Lib/test/test_runpy.py')
-rw-r--r-- | Lib/test/test_runpy.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py index 9d76764..b64383f 100644 --- a/Lib/test/test_runpy.py +++ b/Lib/test/test_runpy.py @@ -15,7 +15,7 @@ import warnings from test.support import (infinite_recursion, no_tracing, verbose, requires_subprocess, requires_resource) from test.support.import_helper import forget, make_legacy_pyc, unload -from test.support.os_helper import create_empty_file, temp_dir +from test.support.os_helper import create_empty_file, temp_dir, FakePath from test.support.script_helper import make_script, make_zip_script @@ -657,14 +657,13 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin): self._check_script(script_name, "<run_path>", script_name, script_name, expect_spec=False) - def test_basic_script_with_path_object(self): + def test_basic_script_with_pathlike_object(self): with temp_dir() as script_dir: mod_name = 'script' - script_name = pathlib.Path(self._make_test_script(script_dir, - mod_name)) - self._check_script(script_name, "<run_path>", - os.fsdecode(script_name), - os.fsdecode(script_name), + script_name = self._make_test_script(script_dir, mod_name) + self._check_script(FakePath(script_name), "<run_path>", + script_name, + script_name, expect_spec=False) def test_basic_script_no_suffix(self): |