MCPcopy Index your code
hub / github.com/python/cpython / test_send_signal_race2

Method test_send_signal_race2

Lib/test/test_subprocess.py:3533–3545  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3531 self.assertIsNotNone(proc.returncode)
3532
3533 def test_send_signal_race2(self):
3534 # bpo-40550: the process might exist between the returncode check and
3535 # the kill operation
3536 p = subprocess.Popen([sys.executable, '-c', 'exit(1)'])
3537
3538 # wait for process to exit
3539 while not p.returncode:
3540 p.poll()
3541
3542 with mock.patch.object(p, 'poll', new=lambda: None):
3543 p.returncode = None
3544 p.send_signal(signal.SIGTERM)
3545 p.kill()
3546
3547 def test_communicate_repeated_call_after_stdout_close(self):
3548 proc = subprocess.Popen([sys.executable, '-c',

Callers

nothing calls this directly

Calls 3

pollMethod · 0.95
send_signalMethod · 0.95
killMethod · 0.95

Tested by

no test coverage detected