1dd24616a25ff0e0df896cef589c8282335af77f
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from test
import test_support
for name
in dir(_testcapi
):
if name
.startswith('test_'):
test
= getattr(_testcapi
, name
)
raise test_support
.TestFailed
, sys
.exc_info()[1]
# some extra thread-state tests driven via _testcapi
print "auto-thread-state"
idents
.append(thread
.get_ident())
_testcapi
._test
_thread
_state
(callback
)
# Check our main thread is in the list exactly 3 times.
if idents
.count(thread
.get_ident()) != 3:
raise test_support
.TestFailed
, \
"Couldn't find main thread correctly in the list"
_testcapi
._test
_thread
_state
have_thread_state
= False
t
=threading
.Thread(target
=TestThreadState
)