summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_runpy.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2016-09-08 01:37:17 (GMT)
committerEric Snow <ericsnowcurrently@gmail.com>2016-09-08 01:37:17 (GMT)
commitd5f92239818eef182fadc7c6f81f70912090573d (patch)
tree6ac89131eb8c69f3f2a752cbde3a6376f86f9454 /Lib/test/test_runpy.py
parent8e7cdb2586193726e0263eeec82c05f2a0d9c2c9 (diff)
downloadcpython-d5f92239818eef182fadc7c6f81f70912090573d.zip
cpython-d5f92239818eef182fadc7c6f81f70912090573d.tar.gz
cpython-d5f92239818eef182fadc7c6f81f70912090573d.tar.bz2
Issue #17211: Yield a namedtuple in pkgutil.
Patch by Ramchandra Apte.
Diffstat (limited to 'Lib/test/test_runpy.py')
-rw-r--r--Lib/test/test_runpy.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py
index db55db7..02b4d62 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -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)