From 8a33284d191025bc387644666807311eb7d60384 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 8 Jul 2016 11:00:00 -0700 Subject: Issue #26896: Disambiguate uses of "importer" with "finder". Thanks to Oren Milman for the patch. --- Lib/test/test_pkgutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/test_pkgutil.py') diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index 9d2035464c..a82058760d 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -205,7 +205,7 @@ class PkgutilPEP302Tests(unittest.TestCase): del sys.meta_path[0] def test_getdata_pep302(self): - # Use a dummy importer/loader + # Use a dummy finder/loader self.assertEqual(pkgutil.get_data('foo', 'dummy'), "Hello, world!") del sys.modules['foo'] -- cgit v1.2.1 From 3517d089841796cb8f9982fff81db0b03c65915f Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 12 Aug 2016 10:53:53 -0700 Subject: Issue #25805: Skip a test for test_pkgutil when __name__ == __main__. Thanks to SilentGhost for the patch. --- Lib/test/test_pkgutil.py | 1 + 1 file changed, 1 insertion(+) (limited to 'Lib/test/test_pkgutil.py') diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index a82058760d..ae2aa1bcea 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -413,6 +413,7 @@ class ImportlibMigrationTests(unittest.TestCase): self.assertIsNotNone(pkgutil.get_loader("test.support")) self.assertEqual(len(w.warnings), 0) + @unittest.skipIf(__name__ == '__main__', 'not compatible with __main__') def test_get_loader_handles_missing_loader_attribute(self): global __loader__ this_loader = __loader__ -- cgit v1.2.1 From c34cb33ce06360d4c26202402755fb05d7a134ac Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 7 Sep 2016 18:37:17 -0700 Subject: Issue #17211: Yield a namedtuple in pkgutil. Patch by Ramchandra Apte. --- Lib/test/test_pkgutil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_pkgutil.py') diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index ae2aa1bcea..fc04dcfd7f 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -81,8 +81,9 @@ class PkgutilTests(unittest.TestCase): self.assertEqual(res2, RESOURCE_DATA) names = [] - for loader, name, ispkg in pkgutil.iter_modules([zip_file]): - names.append(name) + for moduleinfo in pkgutil.iter_modules([zip_file]): + self.assertIsInstance(moduleinfo, pkgutil.ModuleInfo) + names.append(moduleinfo.name) self.assertEqual(names, ['test_getdata_zipfile']) del sys.path[0] -- cgit v1.2.1