Back to index

python3.2  3.2.2
Public Member Functions
test.test_concurrent_futures.ExecutorTest Class Reference
Inheritance diagram for test.test_concurrent_futures.ExecutorTest:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def test_submit
def test_submit_keyword
def test_map
def test_map_exception
def test_map_timeout

Detailed Description

Definition at line 334 of file test_concurrent_futures.py.


Member Function Documentation

Definition at line 345 of file test_concurrent_futures.py.

00345 
00346     def test_map(self):
00347         self.assertEqual(
00348                 list(self.executor.map(pow, range(10), range(10))),
00349                 list(map(pow, range(10), range(10))))

Here is the call graph for this function:

Definition at line 350 of file test_concurrent_futures.py.

00350 
00351     def test_map_exception(self):
00352         i = self.executor.map(divmod, [1, 1, 1, 1], [2, 3, 0, 5])
00353         self.assertEqual(i.__next__(), (0, 1))
00354         self.assertEqual(i.__next__(), (0, 1))
00355         self.assertRaises(ZeroDivisionError, i.__next__)

Here is the call graph for this function:

Definition at line 356 of file test_concurrent_futures.py.

00356 
00357     def test_map_timeout(self):
00358         results = []
00359         try:
00360             for i in self.executor.map(time.sleep,
00361                                        [0, 0, 3],
00362                                        timeout=1.5):
00363                 results.append(i)
00364         except futures.TimeoutError:
00365             pass
00366         else:
00367             self.fail('expected TimeoutError')
00368 
00369         self.assertEqual([None, None], results)
00370 

Here is the call graph for this function:

Definition at line 337 of file test_concurrent_futures.py.

00337 
00338     def test_submit(self):
00339         future = self.executor.submit(pow, 2, 8)
00340         self.assertEqual(256, future.result())

Here is the call graph for this function:

Definition at line 341 of file test_concurrent_futures.py.

00341 
00342     def test_submit_keyword(self):
00343         future = self.executor.submit(mul, 2, y=8)
00344         self.assertEqual(16, future.result())

Here is the call graph for this function:


The documentation for this class was generated from the following file: