[New-bugs-announce] [issue22060] Clean up ctypes.test, use unittest test discovery
report at bugs.python.org
Thu Jul 24 22:32:05 CEST 2014
New submission from Zachary Ware:
Attached is a patch that aims to clean up the ctypes tests a bit, namely by removing the custom resource management (which conflicts with regrtest), the custom test discovery (which is better left to unittest), and the custom test running (which is better covered by unittest and regrtest). The one thing I'm not entirely confident about removing is the custom refleak testing, but it does not seem to work correctly in 3.x anyway (though in 2.7, the custom refleak hunter reports "leaks" that the regrtest refleak hunter does not).
There were only a few uses of the custom resource management, all of which were replaced or removed. test_SEH in test_win32 used "requires('SEH')", but that test should now be sufficiently guarded with unittest skip decorators (only trying the test on Windows, with Python built in Release configuration by MSVC). test_PyLong_Long in test_python_api used "requires('refcount')", but that should be covered by the @support.refcount_test decorator (added long after the 'requires' call). Two instances of "is_resource_enabled('printing')" were replaced by "if test.support.verbose".
The same number of tests run (all successfully) on Windows, I have not yet tested on any other platforms.
components: Tests, ctypes
nosy: amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka, zach.ware
stage: patch review
title: Clean up ctypes.test, use unittest test discovery
versions: Python 3.5
Added file: http://bugs.python.org/file36073/ctypes.test-cleanup.diff
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce