Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_capi Namespace Reference

Classes

class  InstanceMethod
class  CAPITest
class  TestPendingCalls
class  Test6012
class  EmbeddingTest

Functions

def testfunction
def test_main

Variables

 threading = None

Function Documentation

Definition at line 178 of file test_capi.py.

00178 
00179 def test_main():
00180     support.run_unittest(CAPITest, TestPendingCalls, Test6012, EmbeddingTest)
00181 
00182     for name in dir(_testcapi):
00183         if name.startswith('test_'):
00184             test = getattr(_testcapi, name)
00185             if support.verbose:
00186                 print("internal", name)
00187             test()
00188 
00189     # some extra thread-state tests driven via _testcapi
00190     def TestThreadState():
00191         if support.verbose:
00192             print("auto-thread-state")
00193 
00194         idents = []
00195 
00196         def callback():
00197             idents.append(_thread.get_ident())
00198 
00199         _testcapi._test_thread_state(callback)
00200         a = b = callback
00201         time.sleep(1)
00202         # Check our main thread is in the list exactly 3 times.
00203         if idents.count(_thread.get_ident()) != 3:
00204             raise support.TestFailed(
00205                         "Couldn't find main thread correctly in the list")
00206 
00207     if threading:
00208         import _thread
00209         import time
00210         TestThreadState()
00211         t = threading.Thread(target=TestThreadState)
00212         t.start()
00213         t.join()
00214 

Here is the call graph for this function:

some doc

Definition at line 19 of file test_capi.py.

00019 
00020 def testfunction(self):
00021     """some doc"""
00022     return self


Variable Documentation

Definition at line 15 of file test_capi.py.