[Python-checkins] cpython: Issue #25805: Skip a test for test_pkgutil when __name__ == __main__.

brett.cannon python-checkins at python.org
Fri Aug 12 13:53:59 EDT 2016


https://hg.python.org/cpython/rev/863258dcb745
changeset:   102623:863258dcb745
user:        Brett Cannon <brett at python.org>
date:        Fri Aug 12 10:53:53 2016 -0700
summary:
  Issue #25805: Skip a test for test_pkgutil when __name__ == __main__.

Thanks to SilentGhost for the patch.

files:
  Lib/test/test_pkgutil.py |  1 +
  Misc/NEWS                |  3 +++
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -413,6 +413,7 @@
             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__
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -96,6 +96,9 @@
 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

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list