Issue 17751: ctypes/test/test_macholib.py fails when run from the installed location (original) (raw)

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:44 admin set github: 61951
2015-04-14 17:02:28 zach.ware set status: open -> closedresolution: out of datemessages: + stage: needs patch -> resolved
2015-04-14 16:53:37 morkov set messages: +
2015-04-13 17:27:37 zach.ware set messages: +
2015-04-13 17:19:42 morkov set messages: +
2015-04-13 15:21:54 zach.ware set nosy: + zach.waremessages: +
2015-04-13 15🔞12 morkov set nosy: + morkovmessages: +
2014-07-29 17:43:37 BreamoreBoy set nosy: + BreamoreBoy, ezio.melotti, pitrou, michael.foordmessages: + versions: + Python 3.5, - Python 3.3, Python 3.4
2013-04-16 10:47:23 doko link issue17750 dependencies
2013-04-16 10:46:52 doko create