diff options
author | Alex Gr?nholm <alex.gronholm@nextday.fi> | 2012-08-25 06:36:15 +0000 |
---|---|---|
committer | Alex Gr?nholm <alex.gronholm@nextday.fi> | 2012-08-25 06:36:15 +0000 |
commit | 75441481c4e5855f18d1772064e6d5f44b2a3730 (patch) | |
tree | 0ecf2f325b933ed60be37ea36e7e5894d71225de | |
parent | ffdf5c31d693e031ec497754797d23b2bcae864d (diff) | |
download | futures-75441481c4e5855f18d1772064e6d5f44b2a3730.tar.gz |
Added missing setUp() methods to several test classes
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | test_futures.py | 13 |
2 files changed, 18 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2.1.3 +===== + +- Added missing setUp() methods to several test classes + + 2.1.2 ===== diff --git a/test_futures.py b/test_futures.py index bbc21a0..725a60b 100644 --- a/test_futures.py +++ b/test_futures.py @@ -135,13 +135,15 @@ class MapCall(Call): return self._result class ExecutorShutdownTest(unittest.TestCase): + def setUp(self): + self.executor = futures.ProcessPoolExecutor(max_workers=1) + def test_run_after_shutdown(self): self.executor.shutdown() self.assertRaises(RuntimeError, self.executor.submit, pow, 2, 5) - def _start_some_futures(self): call1 = Call(manual_finish=True) call2 = Call(manual_finish=True) @@ -233,6 +235,9 @@ class ProcessPoolShutdownTest(ExecutorShutdownTest): p.join() class WaitTests(unittest.TestCase): + def setUp(self): + self.executor = futures.ProcessPoolExecutor(max_workers=1) + def test_first_completed(self): def wait_test(): while not future1._waiters: @@ -464,6 +469,9 @@ class ProcessPoolWaitTests(WaitTests): self.executor.shutdown(wait=True) class AsCompletedTests(unittest.TestCase): + def setUp(self): + self.executor = futures.ProcessPoolExecutor(max_workers=1) + # TODO(brian@sweetapp.com): Should have a test with a non-zero timeout. def test_no_timeout(self): def wait_test(): @@ -533,6 +541,9 @@ class ProcessPoolAsCompletedTests(AsCompletedTests): self.executor.shutdown(wait=True) class ExecutorTest(unittest.TestCase): + def setUp(self): + self.executor = futures.ProcessPoolExecutor(max_workers=1) + # Executor.shutdown() and context manager usage is tested by # ExecutorShutdownTest. def test_submit(self): |