Back to index

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

Classes

class  ExecutorMixin
class  ThreadPoolMixin
class  ProcessPoolMixin
class  ExecutorShutdownTest
class  ThreadPoolShutdownTest
class  ProcessPoolShutdownTest
class  WaitTests
class  ThreadPoolWaitTests
class  ProcessPoolWaitTests
class  AsCompletedTests
class  ThreadPoolAsCompletedTests
class  ProcessPoolAsCompletedTests
class  ExecutorTest
class  ThreadPoolExecutorTest
class  ProcessPoolExecutorTest
class  FutureTests

Functions

def create_future
def mul
def sleep_and_raise
def sleep_and_print
def test_main

Variables

tuple PENDING_FUTURE = create_future(state=PENDING)
tuple RUNNING_FUTURE = create_future(state=RUNNING)
tuple CANCELLED_FUTURE = create_future(state=CANCELLED)
tuple CANCELLED_AND_NOTIFIED_FUTURE = create_future(state=CANCELLED_AND_NOTIFIED)
tuple EXCEPTION_FUTURE = create_future(state=FINISHED, exception=IOError())
tuple SUCCESSFUL_FUTURE = create_future(state=FINISHED, result=42)

Function Documentation

def test.test_concurrent_futures.create_future (   state = PENDING,
  exception = None,
  result = None 
)

Definition at line 25 of file test_concurrent_futures.py.

00025 
00026 def create_future(state=PENDING, exception=None, result=None):
00027     f = Future()
00028     f._state = state
00029     f._exception = exception
00030     f._result = result
00031     return f
00032 

Here is the caller graph for this function:

def test.test_concurrent_futures.mul (   x,
  y 
)

Definition at line 41 of file test_concurrent_futures.py.

00041 
00042 def mul(x, y):
00043     return x * y
00044 

Definition at line 49 of file test_concurrent_futures.py.

00049 
00050 def sleep_and_print(t, msg):
00051     time.sleep(t)
00052     print(msg)
00053     sys.stdout.flush()
00054 

Definition at line 45 of file test_concurrent_futures.py.

00045 
00046 def sleep_and_raise(t):
00047     time.sleep(t)
00048     raise Exception('this is an exception')

Definition at line 602 of file test_concurrent_futures.py.

00602 
00603 def test_main():
00604     try:
00605         test.support.run_unittest(ProcessPoolExecutorTest,
00606                                   ThreadPoolExecutorTest,
00607                                   ProcessPoolWaitTests,
00608                                   ThreadPoolWaitTests,
00609                                   ProcessPoolAsCompletedTests,
00610                                   ThreadPoolAsCompletedTests,
00611                                   FutureTests,
00612                                   ProcessPoolShutdownTest,
00613                                   ThreadPoolShutdownTest)
00614     finally:
00615         test.support.reap_children()

Here is the call graph for this function:


Variable Documentation

Definition at line 36 of file test_concurrent_futures.py.

Definition at line 35 of file test_concurrent_futures.py.

tuple test.test_concurrent_futures.EXCEPTION_FUTURE = create_future(state=FINISHED, exception=IOError())

Definition at line 37 of file test_concurrent_futures.py.

Definition at line 33 of file test_concurrent_futures.py.

Definition at line 34 of file test_concurrent_futures.py.

Definition at line 38 of file test_concurrent_futures.py.