@@ -233,28 +233,28 @@ def mock_start_new_thread(func, *args, **kwargs):
233233 list (executor .map (mul , [(2 , 3 )] * 10 ))
234234 executor .shutdown ()
235235
236- def test_process_pool_executor_terminate_workers (self ):
236+ def test_terminate_workers (self ):
237237 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
238238 executor ._terminate_or_kill_workers = unittest .mock .Mock ()
239239 executor .terminate_workers ()
240240
241241 executor ._terminate_or_kill_workers .assert_called_once_with (operation = futures .process ._TERMINATE )
242242
243- def test_process_pool_executor_kill_workers (self ):
243+ def test_kill_workers (self ):
244244 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
245245 executor ._terminate_or_kill_workers = unittest .mock .Mock ()
246246 executor .kill_workers ()
247247
248248 executor ._terminate_or_kill_workers .assert_called_once_with (operation = futures .process ._KILL )
249249
250- def test_process_pool_executor_terminate_or_kill_workers_invalid_op (self ):
250+ def test_terminate_or_kill_workers_invalid_op (self ):
251251 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
252252 self .assertRaises (ValueError ,
253253 executor ._terminate_or_kill_workers ,
254254 operation = 'invalid operation' ),
255255
256256 @parameterize (* TERMINATE_OR_KILL_PARAMS )
257- def test_process_pool_executor_terminate_kill_workers (self , function_name ):
257+ def test_terminate_kill_workers (self , function_name ):
258258 manager = self .get_context ().Manager ()
259259 q = manager .Queue ()
260260
@@ -279,7 +279,7 @@ def test_process_pool_executor_terminate_kill_workers(self, function_name):
279279 self .assertRaises (queue .Empty , q .get , timeout = 1 )
280280
281281 @parameterize (* TERMINATE_OR_KILL_PARAMS )
282- def test_process_pool_executor_terminate_kill_workers_dead_workers (self , function_name ):
282+ def test_terminate_kill_workers_dead_workers (self , function_name ):
283283 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
284284 future = executor .submit (os ._exit , 1 )
285285 self .assertRaises (BrokenProcessPool , future .result )
@@ -288,7 +288,7 @@ def test_process_pool_executor_terminate_kill_workers_dead_workers(self, functio
288288 getattr (executor , function_name )()
289289
290290 @parameterize (* TERMINATE_OR_KILL_PARAMS )
291- def test_process_pool_executor_terminate_kill_workers_not_started_yet (self , function_name ):
291+ def test_terminate_kill_workers_not_started_yet (self , function_name ):
292292 ctx = self .get_context ()
293293 with unittest .mock .patch .object (ctx , 'Process' ) as mock_process :
294294 with futures .ProcessPoolExecutor (max_workers = 1 , mp_context = ctx ) as executor :
@@ -300,9 +300,10 @@ def test_process_pool_executor_terminate_kill_workers_not_started_yet(self, func
300300 mock_process .return_value .terminate .assert_not_called ()
301301
302302 @parameterize (* TERMINATE_OR_KILL_PARAMS )
303- def test_process_pool_executor_terminate_kill_workers_stops_pool (self , function_name ):
303+ def test_terminate_kill_workers_stops_pool (self , function_name ):
304304 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
305- executor .submit (time .sleep , 0 ).result ()
305+ task = executor .submit (time .sleep , 0 )
306+ self .assertIsNone (task .result ())
306307
307308 getattr (executor , function_name )()
308309
0 commit comments