mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
[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:
parent
bca7fb0e7a
commit
1dc7fcd803
19 changed files with 115 additions and 127 deletions
|
@ -13,6 +13,7 @@ import shutil
|
|||
import zipfile
|
||||
|
||||
from test.support.import_helper import DirsOnSysPath
|
||||
from test.support.os_helper import FakePath
|
||||
from test.test_importlib.util import uncache
|
||||
|
||||
# Note: pkgutil.walk_packages is currently tested in test_runpy. This is
|
||||
|
@ -121,7 +122,7 @@ class PkgutilTests(unittest.TestCase):
|
|||
|
||||
# make sure iter_modules accepts Path objects
|
||||
names = []
|
||||
for moduleinfo in pkgutil.iter_modules([Path(zip_file)]):
|
||||
for moduleinfo in pkgutil.iter_modules([FakePath(zip_file)]):
|
||||
self.assertIsInstance(moduleinfo, pkgutil.ModuleInfo)
|
||||
names.append(moduleinfo.name)
|
||||
self.assertEqual(names, [pkg])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue