MCPcopy
hub / github.com/pytest-dev/pytest / test_pdb_and_capsys

Method test_pdb_and_capsys

testing/test_debugging.py:463–478  ·  testing/test_debugging.py::TestPDB.test_pdb_and_capsys
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

461 self.flush(child)
462
463 def test_pdb_and_capsys(self, pytester: Pytester) -> None:
464 p1 = pytester.makepyfile(
465 class="st">"""
466 import pytest
467 def test_1(capsys):
468 print(class="st">"hello1")
469 pytest.set_trace()
470 class="st">"""
471 )
472 child = pytester.spawn_pytest(str(p1))
473 child.expect(class="st">"test_1")
474 child.send(class="st">"capsys.readouterr()\n")
475 child.expect(class="st">"hello1")
476 child.sendeof()
477 child.read()
478 self.flush(child)
479
480 def test_pdb_with_caplog_on_pdb_invocation(self, pytester: Pytester) -> None:
481 p1 = pytester.makepyfile(

Callers

nothing calls this directly

Calls 4

flushMethod · 0.95
makepyfileMethod · 0.45
spawn_pytestMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected