mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
parent
8e7cdb2586
commit
d5f9223981
5 changed files with 35 additions and 21 deletions
|
@ -577,13 +577,14 @@ from ..uncle.cousin import nephew
|
|||
self.addCleanup(self._del_pkg, pkg_dir)
|
||||
for depth in range(2, max_depth+1):
|
||||
self._add_relative_modules(pkg_dir, "", depth)
|
||||
for finder, mod_name, ispkg in pkgutil.walk_packages([pkg_dir]):
|
||||
self.assertIsInstance(finder,
|
||||
for moduleinfo in pkgutil.walk_packages([pkg_dir]):
|
||||
self.assertIsInstance(moduleinfo, pkgutil.ModuleInfo)
|
||||
self.assertIsInstance(moduleinfo.module_finder,
|
||||
importlib.machinery.FileFinder)
|
||||
if ispkg:
|
||||
expected_packages.remove(mod_name)
|
||||
if moduleinfo.ispkg:
|
||||
expected_packages.remove(moduleinfo.name)
|
||||
else:
|
||||
expected_modules.remove(mod_name)
|
||||
expected_modules.remove(moduleinfo.name)
|
||||
self.assertEqual(len(expected_packages), 0, expected_packages)
|
||||
self.assertEqual(len(expected_modules), 0, expected_modules)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue