(self, pytester, showcapture: str)
| 280 | |
| 281 | @pytest.mark.parametrize(class="st">"showcapture", [class="st">"all", class="st">"no", class="st">"log"]) |
| 282 | def test_pdb_print_captured_logs(self, pytester, showcapture: str) -> None: |
| 283 | p1 = pytester.makepyfile( |
| 284 | class="st">""" |
| 285 | def test_1(): |
| 286 | import logging |
| 287 | logging.warning(class="st">"get " + class="st">"rekt") |
| 288 | assert False |
| 289 | class="st">""" |
| 290 | ) |
| 291 | child = pytester.spawn_pytest(fclass="st">"--show-capture={showcapture} --pdb {p1}") |
| 292 | if showcapture in (class="st">"all", class="st">"log"): |
| 293 | child.expect(class="st">"captured log") |
| 294 | child.expect(class="st">"get rekt") |
| 295 | child.expect(class="st">"Pdb") |
| 296 | child.sendeof() |
| 297 | rest = child.read().decode(class="st">"utf8") |
| 298 | assert class="st">"1 failed" in rest |
| 299 | self.flush(child) |
| 300 | |
| 301 | def test_pdb_print_captured_logs_nologging(self, pytester: Pytester) -> None: |
| 302 | p1 = pytester.makepyfile( |
nothing calls this directly
no test coverage detected