MCPcopy Index your code
hub / github.com/RustPython/RustPython / simple_subprocess

Function simple_subprocess

Lib/test/test_socketserver.py:48–59  ·  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

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

Callers 3

test_ForkingTCPServerMethod · 0.85
test_ForkingUDPServerMethod · 0.85

Calls 1

_exitMethod · 0.45

Tested by

no test coverage detected