Commit Graph

19 Commits

Author SHA1 Message Date
Victor Stinner be595d336c Issue #7449, part 7: simplify threading detection in test_capi
* Skip TestPendingCalls if threading module is missing
 * Test if threading module is present or not, instead of test the presence of
   _testcapi._test_thread_state
2010-04-27 23:01:29 +00:00
Ezio Melotti dde5b94875 #7092: Silence more py3k warnings. Patch by Florent Xicluna. 2010-02-03 05:37:26 +00:00
Senthil Kumaran ce8e33a095 Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
2010-01-08 19:04:16 +00:00
Senthil Kumaran 3ddc435af6 Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox 2010-01-08 18:41:40 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Kristján Valur Jónsson 60e79ced94 issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16. 2009-01-18 10:58:44 +00:00
Kristján Valur Jónsson 0e2d8c36e3 Issue 4293: Make Py_AddPendingCall() thread safe
Add test cases and documentation
2009-01-09 21:35:16 +00:00
Amaury Forgeot d'Arc 4b798bdf8a Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
suite as a side-effect of importing the module.

- in test_capi, a thread tried to import other modules
- re.compile() imported sre_parse again on every call.
2008-04-08 21:27:42 +00:00
Tim Peters 59b96c1029 Try to repair at least one segfault on the Mac buildbot,
as diagnosed by Nick Coghlan.

test_capi.py:  A test module should never spawn a thread as
a side effect of being imported.  Because this one did, the
segfault one of its thread tests caused didn't occur until
a few tests after test_regrtest.py thought test_capi was
finished.  Repair that.  Also join() the thread spawned
at the end, so that test_capi is truly finished when
regrtest reports that it's done.

_testcapimodule.c test_thread_state():  this spawns a
couple of non-threading.py threads, passing them a PyObject*
argument, but did nothing to ensure that those threads
finished before returning.  As a result, the PyObject*
_could_ (although this was unlikely) get decref'ed out of
existence before the threads got around to using it.
Added explicit synchronization (via a Python mutex) so
that test_thread_state can reliably wait for its spawned
threads to finish.
2006-03-21 03:58:41 +00:00
Martin v. Löwis 6ce7ed23d0 Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly.
Backported to 2.4.
2005-03-03 12:26:35 +00:00
Martin v. Löwis ff232d7230 Clear internal call error in 'L' format. Fixes #723201.
Backported to 2.4.
2005-03-03 09:24:38 +00:00
Tim Peters 66cb018c96 Whitespace normalization. 2004-08-26 05:23:19 +00:00
Mark Hammond eb619bb80b Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),
and a test case.
When booting a new thread, use the PyGILState API to manage the GIL.
2004-08-24 22:24:08 +00:00
Tim Peters 0eadaac7dc Whitespace normalization. 2003-04-24 16:02:54 +00:00
Mark Hammond 8d98d2cb95 New PyGILState_ API - implements pep 311, from patch 684256. 2003-04-19 15:41:53 +00:00
Barry Warsaw 04f357cffe Get rid of relative imports in all unittests. Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".

This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).

Now Tim and Jack can have at it. :)
2002-07-23 19:04:11 +00:00
Guido van Rossum 361c535863 Fix typo in comment (the module is now called _testcapi, not _test). 2001-04-13 17:03:04 +00:00
Tim Peters d66595fe42 Renamed _testXXX to _testcapiXXX. Jack is my hero -- good call! 2001-02-04 03:09:53 +00:00
Tim Peters 9ea17ac595 Patch derived from Trent's 101162: a Python/C API testing framework.
STILL NEEDS UNIX BUILD CHANGES.
2001-02-02 05:57:15 +00:00