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

Function test_trace_after_runpytest

testing/test_debugging.py:1130–1158  ·  view source on GitHub ↗

Test that debugging's pytest_configure is re-entrant.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1128
1129
1130def test_trace_after_runpytest(pytester: Pytester) -> None:
1131 """Test that debugging's pytest_configure is re-entrant."""
1132 p1 = pytester.makepyfile(
1133 """
1134 from _pytest.debugging import pytestPDB
1135
1136 def test_outer(pytester) -> None:
1137 assert len(pytestPDB._saved) == 1
1138
1139 pytester.makepyfile(
1140 \"""
1141 from _pytest.debugging import pytestPDB
1142
1143 def test_inner():
1144 assert len(pytestPDB._saved) == 2
1145 print()
1146 print("test_inner_" + "end")
1147 \"""
1148 )
1149
1150 result = pytester.runpytest("-s", "-k", "test_inner")
1151 assert result.ret == 0
1152
1153 assert len(pytestPDB._saved) == 1
1154 """
1155 )
1156 result = pytester.runpytest_subprocess("-s", "-p", "pytester", str(p1))
1157 result.stdout.fnmatch_lines(["test_inner_end"])
1158 assert result.ret == 0
1159
1160
1161def test_quit_with_swallowed_SystemExit(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