(self, pytester: Pytester)
| 509 | self.flush(child) |
| 510 | |
| 511 | def test_doctest_set_trace_quit(self, pytester: Pytester) -> None: |
| 512 | p1 = pytester.makepyfile( |
| 513 | """ |
| 514 | def function_1(): |
| 515 | ''' |
| 516 | >>> __import__('pdb').set_trace() |
| 517 | ''' |
| 518 | """ |
| 519 | ) |
| 520 | # NOTE: does not use pytest.set_trace, but Python's patched pdb, |
| 521 | # therefore "-s" is required. |
| 522 | child = pytester.spawn_pytest("--doctest-modules --pdb -s %s" % p1) |
| 523 | child.expect("Pdb") |
| 524 | child.sendline("q") |
| 525 | rest = child.read().decode("utf8") |
| 526 | |
| 527 | assert "! _pytest.outcomes.Exit: Quitting debugger !" in rest |
| 528 | assert "= no tests ran in" in rest |
| 529 | assert "BdbQuit" not in rest |
| 530 | assert "UNEXPECTED EXCEPTION" not in rest |
| 531 | |
| 532 | def test_pdb_interaction_capturing_twice(self, pytester: Pytester) -> None: |
| 533 | p1 = pytester.makepyfile( |
nothing calls this directly
no test coverage detected