This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Failure in test_pkgutil run from command-line
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: SilentGhost, alexis, brett.cannon, dstufft, eric.araujo, lemburg, paul.moore, python-dev, r.david.murray, tarek
Priority: normal Keywords: patch

Created on 2015-12-05 09:08 by SilentGhost, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue25805.diff SilentGhost, 2016-03-23 09:18 review
Messages (5)
msg255939 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-12-05 09:08
Running ./python Lib/test/test_pkgutil.py I got one test failing:

test.support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_pkgutil.py", line 346, in test_get_loader_handles_missing_loader_attribute
    self.assertIsNotNone(pkgutil.get_loader(__name__))
AssertionError: unexpectedly None

When run as `./python -m test test_pkgutil` everything is fine.
msg262251 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-03-23 09:18
Upon further investigation it seems this particular test needs to be just skipped when running as __main__.
msg272548 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-12 17:24
Could anyone could have a look at this fairly trivial patch?
msg272550 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-08-12 17:54
New changeset 863258dcb745 by Brett Cannon in branch 'default':
Issue #25805: Skip a test for test_pkgutil when __name__ == __main__.
https://hg.python.org/cpython/rev/863258dcb745
msg272551 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-08-12 17:54
Since most people just run tests using `-m test` I only applied the fix to 3.6. Thanks for the patch, SilentGhost!
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 69991
2016-08-12 17:58:29brett.cannonsetstage: patch review -> resolved
2016-08-12 17:54:39brett.cannonsetstatus: open -> closed
resolution: fixed
messages: + msg272551
2016-08-12 17:54:02python-devsetnosy: + python-dev
messages: + msg272550
2016-08-12 17:51:19brett.cannonsetassignee: brett.cannon

nosy: + brett.cannon
2016-08-12 17:24:38SilentGhostsetmessages: + msg272548
2016-03-29 10:04:34SilentGhostsetnosy: + r.david.murray

versions: + Python 3.5
2016-03-23 09:18:51SilentGhostsetfiles: + issue25805.diff
keywords: + patch
messages: + msg262251

stage: patch review
2015-12-05 09:08:04SilentGhostcreate