Test that debugging's pytest_configure is re-entrant.
(pytester: Pytester)
| 1159 | |
| 1160 | |
| 1161 | def test_quit_with_swallowed_SystemExit(pytester: Pytester) -> None: |
| 1162 | """Test that debugging's pytest_configure is re-entrant.""" |
| 1163 | p1 = pytester.makepyfile( |
| 1164 | """ |
| 1165 | def call_pdb_set_trace(): |
| 1166 | __import__('pdb').set_trace() |
| 1167 | |
| 1168 | |
| 1169 | def test_1(): |
| 1170 | try: |
| 1171 | call_pdb_set_trace() |
| 1172 | except SystemExit: |
| 1173 | pass |
| 1174 | |
| 1175 | |
| 1176 | def test_2(): |
| 1177 | pass |
| 1178 | """ |
| 1179 | ) |
| 1180 | child = pytester.spawn_pytest(str(p1)) |
| 1181 | child.expect("Pdb") |
| 1182 | child.sendline("q") |
| 1183 | child.expect_exact("Exit: Quitting debugger") |
| 1184 | rest = child.read().decode("utf8") |
| 1185 | assert "no tests ran" in rest |
| 1186 | TestPDB.flush(child) |
| 1187 | |
| 1188 | |
| 1189 | @pytest.mark.parametrize("fixture", ("capfd", "capsys")) |
nothing calls this directly
no test coverage detected