Test that debugging's pytest_configure is re-entrant.
(pytester: Pytester)
| 1128 | |
| 1129 | |
| 1130 | def 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 | |
| 1161 | def test_quit_with_swallowed_SystemExit(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected