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: ctypes/test/test_macholib.py fails when run from the installed location
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, doko, ezio.melotti, michael.foord, morkov, pitrou, zach.ware
Priority: normal Keywords:

Created on 2013-04-16 10:46 by doko, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (8)
msg187067 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-04-16 10:46
the ctypes tests unconditionally import macholib.dyld, which is not available in an installed testsuite on other platforms. So either don't install this test, or only run the import and test when on MacOS?
msg224237 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-29 17:43
Can we have the opinions of our testing experts please.
msg240620 - (view) Author: Marin Dantchev (morkov) Date: 2015-04-13 15:18
This appears to have been fixed in ef491d76ac70.
msg240621 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-04-13 15:21
@Marin: That changeset is touching test_multiprocessing, not ctypes.test.test_macholib.
msg240668 - (view) Author: Marin Dantchev (morkov) Date: 2015-04-13 17:19
@Zachary: Wrong paste. Correct change is 

Lib\ctypes\test\test_macholib.py@91160:6f63fff5c120, which makes the test only run on OSX.
msg240673 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-04-13 17:27
Ahh.  Not quite, though; that change just changed the way unittest reports the results on non-Mac platforms.  The problem is actually here:

https://hg.python.org/cpython/file/default/Lib/ctypes/test/test_macholib.py#l34

We need a patch to try that import instead of doing it unconditionally, and adjust the existing skip decorator to check whether the import succeeded.
msg240946 - (view) Author: Marin Dantchev (morkov) Date: 2015-04-14 16:53
@Zachary - while that is doable, ctypes.macholib.dyld seems to be available in the dev version of 3.5.

>>> import ctypes.macholib.dyld
>>> ctypes.macholib.dyld.__file__
'/home/morkov/dev/cpython/Lib/ctypes/macholib/dyld.py'
>>> from ctypes.macholib.dyld import dyld_find
>>> dyld_find
<function dyld_find at 0x7fc36c558560>

The test itself is skipped correctly if I run on Linux.

/home/morkov/dev/cpython/python ./Lib/ctypes/test/test_macholib.py
s
----------------------------------------------------------------------
Ran 1 test in 0.001s

OK (skipped=1)
msg240954 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2015-04-14 17:02
My bad, you're right.  Thanks!
History
Date User Action Args
2022-04-11 14:57:44adminsetgithub: 61951
2015-04-14 17:02:28zach.waresetstatus: open -> closed
resolution: out of date
messages: + msg240954

stage: needs patch -> resolved
2015-04-14 16:53:37morkovsetmessages: + msg240946
2015-04-13 17:27:37zach.waresetmessages: + msg240673
2015-04-13 17:19:42morkovsetmessages: + msg240668
2015-04-13 15:21:54zach.waresetnosy: + zach.ware
messages: + msg240621
2015-04-13 15:18:12morkovsetnosy: + morkov
messages: + msg240620
2014-07-29 17:43:37BreamoreBoysetnosy: + BreamoreBoy, ezio.melotti, pitrou, michael.foord

messages: + msg224237
versions: + Python 3.5, - Python 3.3, Python 3.4
2013-04-16 10:47:23dokolinkissue17750 dependencies
2013-04-16 10:46:52dokocreate