Issue 26101: Lib/test/test_compileall.py fails when run directly
Created on 2016-01-13 16:40 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_compileall.patch | vstinner, 2016-01-13 16:40 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg258154 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2016-01-13 16:40 | |
"./python Lib/test/test_compileall.py" fails on test_compile_path() because the Lib/test/ directory is in sys.path and this directory contains invalid Python scripts like Lib/test/badsyntax_pep3120.py Attached patch fixes the issue by removing temporarely Lib/test/ from sys.path. Note: Python 3.5 doesn't test compileall.compile_path() which fails. The new test was added by the changeset 71f071f2e074 of the issue #25768. |
|||
| msg258158 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2016-01-13 17:26 | |
A cleaner way to do what you're after is to use test_importlib.util.import_state() where you can pass in an explicit value for sys.path to be temporarily set. Otherwise I'm fine with the idea of the proposed change. |
|||
| msg258159 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2016-01-13 17:29 | |
> A cleaner way to do what you're after is to use test_importlib.util.import_state() where you can pass in an explicit value for sys.path to be temporarily set. I would prefer to not couple test_importlib and test_compileall to keep tests independent. If you consider that it's worth, import_state() must be moved to test.support. |
|||
| msg258161 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2016-01-13 17:47 | |
Don't care enough to do the work to separate it out, so if you don't want to bother either then LGTM. |
|||
| msg258512 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2016-01-18 10:26 | |
New changeset c6a0f424837a by Victor Stinner in branch 'default': Fix test_compilepath() of test_compileall https://hg.python.org/cpython/rev/c6a0f424837a |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:26 | admin | set | github: 70289 |
| 2016-01-18 11:07:19 | vstinner | set | status: open -> closed resolution: fixed components: + Tests |
| 2016-01-18 10:26:55 | python-dev | set | nosy:
+ python-dev messages: + msg258512 |
| 2016-01-13 17:48:15 | brett.cannon | set | assignee: vstinner |
| 2016-01-13 17:47:59 | brett.cannon | set | messages: + msg258161 |
| 2016-01-13 17:29:53 | vstinner | set | messages: + msg258159 |
| 2016-01-13 17:26:19 | brett.cannon | set | messages: + msg258158 |
| 2016-01-13 16:40:57 | vstinner | create | |

