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

Function test_enabled

testing/test_faulthandler.py:12–23  ·  view source on GitHub ↗

Test single crashing test displays a traceback.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

10
11
12def test_enabled(pytester: Pytester) -> None:
13 """Test single crashing test displays a traceback."""
14 pytester.makepyfile(
15 """
16 import faulthandler
17 def test_crash():
18 faulthandler._sigabrt()
19 """
20 )
21 result = pytester.runpytest_subprocess()
22 result.stderr.fnmatch_lines(["*Fatal Python error*"])
23 assert result.ret != 0
24
25
26def setup_crashing_test(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytest_subprocessMethod · 0.45

Tested by

no test coverage detected