summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pkgutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-05-16 07:25:10 (GMT)
committerGitHub <noreply@github.com>2024-05-16 07:25:10 (GMT)
commit0152dc4ff5534fa2948b95262e70ff6b202b9b99 (patch)
treecf311cb487a6f1956ab942d6356e5b5698659f85 /Lib/test/test_pkgutil.py
parent0142a2292c3d3bfa56a987d576a9678be0f56931 (diff)
downloadcpython-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_pkgutil.py')
-rw-r--r--Lib/test/test_pkgutil.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index e19dce1..d095f44 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -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])