[issue7449] A number tests "crash" if python is compiled --without-threads
Jerry Seutter
report at bugs.python.org
Fri Mar 5 20:45:49 CET 2010
Jerry Seutter <jseutter at gmail.com> added the comment:
Uploaded a new version of the patch, nothreads_3.patch.
@r.david.murray - Good point about unittest.skipUnless, I didn't know about that function. I removed my decorator and used skipUnless() instead.
@haypo:
test_xmlrpc.py - Modified the URL changes so that now the tests should run exactly as before in the multithreaded case.
test_macostools.py - The TESTFN changes are unrelated to the work I am doing. I removed them and will file as a separate item in Roundup.
The skip_if_no decorator has been removed and replaced with unittest.skipUnless().
test_errno.py - You mentioned that only half the tests use threads. The file has two test methods, both of which use threads.
test_sqlite.py - Fixed so that only tests that require threading are skipped. Thank you for the reminder about class decorators.
test_urllib2_localnet.py - I will create an issue in the bug tracker to fix the usage of BaseTestCase. From the svn revision lot it appears the functionality in BaseTestCase is there for a reason and I think it should be fixed.
test_support.py:
- The thread module is now imported once at the top of test_support.
- The reap_threads() function decorates with a thread cleanup function if thread is available, or with a no-op function if thread is not available. Added a docstring.
- Removed "import thread" calls in threading_setup() and threading_cleanup(). Replaced with "if thread" statements.
fork_wait.py - I removed the decorator and use import_module() instead.
test_bz2.py - Modified the import so all but one of the tests run when threading is disabled.
test_multiprocessing.py - Modified to use the try: import threading method of importing the module. It's kind of a moot point because the multiprocessing module does not exist when python is built without threading.
test_capi.py - test_pendingcalls_non_threaded eventually makes a call to testcapi._pending_threadfunc(). testcapi._pending_threadfunc() does not exist when python is built without threading. What I'm trying to say is that both tests rely on threading. I added the skipUnless decorator to both test methods.
test_hashlib.py - Switched to use skipUnless instead.
----------
Added file: http://bugs.python.org/file16464/nothreads_3.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7449>
_______________________________________
More information about the Python-bugs-list
mailing list