Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cb814c commit 4088ad9Copy full SHA for 4088ad9
1 file changed
Lib/test/test_asyncio/test_subprocess.py
@@ -355,11 +355,19 @@ def kill_running():
355
create = self.loop.subprocess_exec(asyncio.SubprocessProtocol,
356
*PROGRAM_BLOCKED)
357
transport, protocol = yield from create
358
+
359
+ kill_called = False
360
+ def kill():
361
+ nonlocal kill_called
362
+ kill_called = True
363
+ orig_kill()
364
365
proc = transport.get_extra_info('subprocess')
- proc.kill = mock.Mock()
366
+ orig_kill = proc.kill
367
+ proc.kill = kill
368
returncode = transport.get_returncode()
369
transport.close()
- return (returncode, proc.kill.called)
370
+ return (returncode, kill_called)
371
372
# Ignore "Close running child process: kill ..." log
373
with test_utils.disable_logger():
0 commit comments