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: errors running test_capi from command line
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, martin.panter, python-dev, zach.ware
Priority: normal Keywords:

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

Messages (4)
msg255888 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-12-04 22:16
Running:

./python Lib/test/test_capi.py

I got EmbeddingTests erroring out in setUp: first line of which (a triple application of os.path.dirname) creates an empty string which cannot be used as an argument to os.chdir afterwards. I'm to be honest not at all sure how this should be properly solved.

Just for the record: running ./python -m test test_capi works fine.
msg255900 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-12-04 23:50
The code looks like it is trying to find the root of the source code tree, and then chdir() to it and access /Programs/_testembed etc.

In your case the chain of dirname() calls returns an empty string because that root is already the current directory. I would make chdir() conditional:

if basepath:
    os.chdir(basepath)
msg255926 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-12-05 06:19
New changeset fae5186562d0 by Zachary Ware in branch '3.4':
Issue #25800: Fix running test_capi directly
https://hg.python.org/cpython/rev/fae5186562d0

New changeset de4108db61f7 by Zachary Ware in branch '3.5':
Issue #25800: Merge with 3.4
https://hg.python.org/cpython/rev/de4108db61f7

New changeset bf3a7373e11a by Zachary Ware in branch 'default':
Closes #25800: Merge with 3.5
https://hg.python.org/cpython/rev/bf3a7373e11a
msg255927 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-12-05 06:20
Thanks for the report!
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 69986
2015-12-05 06:20:25zach.waresettype: behavior
messages: + msg255927
2015-12-05 06:19:38python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg255926

resolution: fixed
stage: resolved
2015-12-05 06:16:05zach.waresetversions: + Python 3.4
2015-12-04 23:50:51martin.pantersetnosy: + martin.panter
messages: + msg255900
2015-12-04 22:16:46SilentGhostcreate