summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-08-12 17:53:53 (GMT)
committerBrett Cannon <brett@python.org>2016-08-12 17:53:53 (GMT)
commit4a2360d3f786053a8e324c4b9587aa6025072689 (patch)
treedb85caf69efaa64dd329443299bf367b0164f8bf
parent87fe473edc933ce8a3c886efff8e6389f90b3e57 (diff)
downloadcpython-4a2360d3f786053a8e324c4b9587aa6025072689.zip
cpython-4a2360d3f786053a8e324c4b9587aa6025072689.tar.gz
cpython-4a2360d3f786053a8e324c4b9587aa6025072689.tar.bz2
Issue #25805: Skip a test for test_pkgutil when __name__ == __main__.
Thanks to SilentGhost for the patch.
-rw-r--r--Lib/test/test_pkgutil.py1
-rw-r--r--Misc/NEWS3
2 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index a820587..ae2aa1b 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__
diff --git a/Misc/NEWS b/Misc/NEWS
index 47855c9..6cd1b1c 100644
--- 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