MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_pytester_run_with_timeout

Function test_pytester_run_with_timeout

testing/test_pytester.py:460–471  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

458
459
460def test_pytester_run_with_timeout(pytester: Pytester) -> None:
461 testfile = pytester.makepyfile("def test_no_timeout(): pass")
462
463 timeout = 120
464
465 start = time.time()
466 result = pytester.runpytest_subprocess(testfile, timeout=timeout)
467 end = time.time()
468 duration = end - start
469
470 assert result.ret == ExitCode.OK
471 assert duration < timeout
472
473
474def test_pytester_run_timeout_expires(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

timeMethod · 0.80
makepyfileMethod · 0.45
runpytest_subprocessMethod · 0.45

Tested by

no test coverage detected