Skip to content

Commit 64693a7

Browse files
committed
Change test to not validate calling of os.kill since shutdown may call that
1 parent 794ee25 commit 64693a7

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

Lib/test/test_concurrent_futures/test_process_pool.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,21 +242,11 @@ def test_process_pool_executor_terminate_workers(self):
242242

243243
self.assertRaises(queue.Empty, q.get, timeout=1)
244244

245-
246245
def test_process_pool_executor_terminate_workers_dead_workers(self):
247246
with futures.ProcessPoolExecutor(max_workers=1) as executor:
248247
future = executor.submit(os._exit, 1)
249248
self.assertRaises(BrokenProcessPool, future.result)
250249

251-
# Patching in here instead of at the function level since we only want
252-
# to patch it for this function call, not other parts of the flow.
253-
with unittest.mock.patch('concurrent.futures.process.os.kill') as mock_kill:
254-
with unittest.mock.patch.object(executor, 'shutdown') as mock_shutdown:
255-
executor.terminate_workers()
256-
mock_shutdown.assert_called_once_with(wait=False, cancel_futures=True)
257-
258-
mock_kill.assert_not_called()
259-
260250
@unittest.mock.patch('concurrent.futures.process.os.kill')
261251
def test_process_pool_executor_terminate_workers_not_started_yet(self, mock_kill):
262252
with futures.ProcessPoolExecutor(max_workers=1) as executor:

0 commit comments

Comments
 (0)