]> granicus.if.org Git - python/commitdiff
Issue #25805: Skip a test for test_pkgutil when __name__ == __main__.
authorBrett Cannon <brett@python.org>
Fri, 12 Aug 2016 17:53:53 +0000 (10:53 -0700)
committerBrett Cannon <brett@python.org>
Fri, 12 Aug 2016 17:53:53 +0000 (10:53 -0700)
Thanks to SilentGhost for the patch.

Lib/test/test_pkgutil.py
Misc/NEWS

index a82058760d82c1deb4cf9f154770bb5676f8b784..ae2aa1bcea54ae274a518e9044f5acb7a3a1e41b 100644 (file)
@@ -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__
index 47855c94c6b6f0e1b4c88e36c9393582cda85670..6cd1b1c3cada6e5731caa3335731d406d5850163 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -96,6 +96,9 @@ Library
 Tests
 -----
 
+- Issue #25805: Skip a test in test_pkgutil as needed that doesn't work when
+  ``__name__ == __main__``. Patch by SilentGhost.
+
 - Issue #27472: Add test.support.unix_shell as the path to the default shell.
 
 - Issue #27369: In test_pyexpat, avoid testing an error message detail that