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

Function simple_subprocess

Lib/test/test_socketserver.py:50–61  ·  view source on GitHub ↗

Tests that a custom child process is not waited on (Issue 1540386)

(testcase)

Source from the content-addressed store, hash-verified

48@test.support.requires_fork()
49@contextlib.contextmanager
50def simple_subprocess(testcase):
51 """Tests that a custom child process is not waited on (Issue 1540386)"""
52 pid = os.fork()
53 if pid == 0:
54 # Don't raise an exception; it would be caught by the test harness.
55 os._exit(72)
56 try:
57 yield None
58 except:
59 raise
60 finally:
61 test.support.wait_process(pid, exitcode=72)
62
63
64class SocketServerTest(unittest.TestCase):

Callers 3

test_ForkingTCPServerMethod · 0.85
test_ForkingUDPServerMethod · 0.85

Calls 1

_exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…