MCPcopy
hub / github.com/pytest-dev/pytest / test_pytester_run_with_timeout

Function test_pytester_run_with_timeout

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

Source from the content-addressed store, hash-verified

449
450
451def test_pytester_run_with_timeout(pytester: Pytester) -> None:
452 testfile = pytester.makepyfile("def test_no_timeout(): pass")
453
454 timeout = 120
455
456 instant = _pytest.timing.Instant()
457 result = pytester.runpytest_subprocess(testfile, timeout=timeout)
458 duration = instant.elapsed()
459
460 assert result.ret == ExitCode.OK
461 assert duration.seconds < timeout
462
463
464def test_pytester_run_timeout_expires(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

elapsedMethod · 0.95
makepyfileMethod · 0.45
runpytest_subprocessMethod · 0.45

Tested by

no test coverage detected