(self, pytester, showcapture: str)
| 248 | |
| 249 | @pytest.mark.parametrize("showcapture", ["all", "no", "log"]) |
| 250 | def test_pdb_print_captured_logs(self, pytester, showcapture: str) -> None: |
| 251 | p1 = pytester.makepyfile( |
| 252 | """ |
| 253 | def test_1(): |
| 254 | import logging |
| 255 | logging.warn("get " + "rekt") |
| 256 | assert False |
| 257 | """ |
| 258 | ) |
| 259 | child = pytester.spawn_pytest(f"--show-capture={showcapture} --pdb {p1}") |
| 260 | if showcapture in ("all", "log"): |
| 261 | child.expect("captured log") |
| 262 | child.expect("get rekt") |
| 263 | child.expect("Pdb") |
| 264 | child.sendeof() |
| 265 | rest = child.read().decode("utf8") |
| 266 | assert "1 failed" in rest |
| 267 | self.flush(child) |
| 268 | |
| 269 | def test_pdb_print_captured_logs_nologging(self, pytester: Pytester) -> None: |
| 270 | p1 = pytester.makepyfile( |
nothing calls this directly
no test coverage detected