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

Function test_enabled

testing/test_faulthandler.py:8–19  ·  view source on GitHub ↗

Test single crashing test displays a traceback.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

6
7
8def test_enabled(pytester: Pytester) -> None:
9 """Test single crashing test displays a traceback."""
10 pytester.makepyfile(
11 """
12 import faulthandler
13 def test_crash():
14 faulthandler._sigabrt()
15 """
16 )
17 result = pytester.runpytest_subprocess()
18 result.stderr.fnmatch_lines(["*Fatal Python error*"])
19 assert result.ret != 0
20
21
22def 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