MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_proc_reader_terminate

Function test_proc_reader_terminate

tests/test_utils.py:216–232  ·  view source on GitHub ↗
(pr_none)

Source from the content-addressed store, hash-verified

214
215
216def test_proc_reader_terminate(pr_none) -> None:
217 assert pr_none._proc.poll() is None
218 pr_none.terminate()
219
220 wait_start = time.monotonic()
221 pr_none.wait()
222 wait_finish = time.monotonic()
223
224 # Make sure the process exited before sleep of 5 seconds finished
225 # 3 seconds accounts for some delay but is long enough for the process to exit
226 assert wait_finish - wait_start < 3
227
228 ret_code = pr_none._proc.poll()
229 if sys.platform.startswith("win"):
230 assert ret_code is not None
231 else:
232 assert ret_code == -signal.SIGTERM
233
234
235@pytest.fixture

Callers

nothing calls this directly

Calls 2

terminateMethod · 0.80
waitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…