[3.13] gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065) (GH-119087)

(cherry picked from commit 0152dc4ff5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-05-16 09:51:18 +02:00 committed by GitHub
parent bca7fb0e7a
commit 1dc7fcd803
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 115 additions and 127 deletions

View file

@ -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):