(self, pytester: Pytester)
| 483 | self.flush(child) |
| 484 | |
| 485 | def test_pdb_interaction_doctest(self, pytester: Pytester) -> None: |
| 486 | p1 = pytester.makepyfile( |
| 487 | """ |
| 488 | def function_1(): |
| 489 | ''' |
| 490 | >>> i = 0 |
| 491 | >>> assert i == 1 |
| 492 | ''' |
| 493 | """ |
| 494 | ) |
| 495 | child = pytester.spawn_pytest("--doctest-modules --pdb %s" % p1) |
| 496 | child.expect("Pdb") |
| 497 | |
| 498 | assert "UNEXPECTED EXCEPTION: AssertionError()" in child.before.decode("utf8") |
| 499 | |
| 500 | child.sendline("'i=%i.' % i") |
| 501 | child.expect("Pdb") |
| 502 | assert "\r\n'i=0.'\r\n" in child.before.decode("utf8") |
| 503 | |
| 504 | child.sendeof() |
| 505 | rest = child.read().decode("utf8") |
| 506 | assert "! _pytest.outcomes.Exit: Quitting debugger !" in rest |
| 507 | assert "BdbQuit" not in rest |
| 508 | assert "1 failed" in rest |
| 509 | self.flush(child) |
| 510 | |
| 511 | def test_doctest_set_trace_quit(self, pytester: Pytester) -> None: |
| 512 | p1 = pytester.makepyfile( |
nothing calls this directly
no test coverage detected