@@ -26,7 +26,7 @@ def __init__(self, mgr):
2626 def __del__ (self ):
2727 self .event .set ()
2828
29- TERMINATE_OR_KILL_PARAMS = [
29+ FORCE_SHUTDOWN_PARAMS = [
3030 dict (function_name = 'terminate_workers' ),
3131 dict (function_name = 'kill_workers' ),
3232]
@@ -235,25 +235,25 @@ def mock_start_new_thread(func, *args, **kwargs):
235235
236236 def test_terminate_workers (self ):
237237 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
238- executor ._terminate_or_kill_workers = unittest .mock .Mock ()
238+ executor ._force_shutdown = unittest .mock .Mock ()
239239 executor .terminate_workers ()
240240
241- executor ._terminate_or_kill_workers .assert_called_once_with (operation = futures .process ._TERMINATE )
241+ executor ._force_shutdown .assert_called_once_with (operation = futures .process ._TERMINATE )
242242
243243 def test_kill_workers (self ):
244244 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
245- executor ._terminate_or_kill_workers = unittest .mock .Mock ()
245+ executor ._force_shutdown = unittest .mock .Mock ()
246246 executor .kill_workers ()
247247
248- executor ._terminate_or_kill_workers .assert_called_once_with (operation = futures .process ._KILL )
248+ executor ._force_shutdown .assert_called_once_with (operation = futures .process ._KILL )
249249
250- def test_terminate_or_kill_workers_invalid_op (self ):
250+ def test_force_shutdown_workers_invalid_op (self ):
251251 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
252252 self .assertRaises (ValueError ,
253- executor ._terminate_or_kill_workers ,
253+ executor ._force_shutdown ,
254254 operation = 'invalid operation' ),
255255
256- @parameterize (* TERMINATE_OR_KILL_PARAMS )
256+ @parameterize (* FORCE_SHUTDOWN_PARAMS )
257257 def test_terminate_kill_workers (self , function_name ):
258258 manager = self .get_context ().Manager ()
259259 q = manager .Queue ()
@@ -278,7 +278,7 @@ def test_terminate_kill_workers(self, function_name):
278278
279279 self .assertRaises (queue .Empty , q .get , timeout = 1 )
280280
281- @parameterize (* TERMINATE_OR_KILL_PARAMS )
281+ @parameterize (* FORCE_SHUTDOWN_PARAMS )
282282 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 )
@@ -287,7 +287,7 @@ def test_terminate_kill_workers_dead_workers(self, function_name):
287287 # even though the pool is broken, this shouldn't raise
288288 getattr (executor , function_name )()
289289
290- @parameterize (* TERMINATE_OR_KILL_PARAMS )
290+ @parameterize (* FORCE_SHUTDOWN_PARAMS )
291291 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 :
@@ -299,7 +299,7 @@ def test_terminate_kill_workers_not_started_yet(self, function_name):
299299 mock_process .return_value .kill .assert_not_called ()
300300 mock_process .return_value .terminate .assert_not_called ()
301301
302- @parameterize (* TERMINATE_OR_KILL_PARAMS )
302+ @parameterize (* FORCE_SHUTDOWN_PARAMS )
303303 def test_terminate_kill_workers_stops_pool (self , function_name ):
304304 with futures .ProcessPoolExecutor (max_workers = 1 ) as executor :
305305 task = executor .submit (time .sleep , 0 )
0 commit comments