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

Method test_pdb_interaction_capturing_simple

testing/test_debugging.py:398–420  ·  testing/test_debugging.py::TestPDB.test_pdb_interaction_capturing_simple
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

396
397 @pytest.mark.xfail(reason=class="st">"class="cm">#10042", strict=False)
398 def test_pdb_interaction_capturing_simple(self, pytester: Pytester) -> None:
399 p1 = pytester.makepyfile(
400 class="st">"""
401 import pytest
402 def test_1():
403 i = 0
404 print(class="st">"hello17")
405 pytest.set_trace()
406 i == 1
407 assert 0
408 class="st">"""
409 )
410 child = pytester.spawn_pytest(str(p1))
411 child.expect(rclass="st">"test_1\(\)")
412 child.expect(class="st">"i == 1")
413 child.expect(class="st">"Pdb")
414 child.sendline(class="st">"c")
415 rest = child.read().decode(class="st">"utf-8")
416 assert class="st">"AssertionError" in rest
417 assert class="st">"1 failed" in rest
418 assert class="st">"def test_1" in rest
419 assert class="st">"hello17" in rest class="cm"># out is captured
420 self.flush(child)
421
422 def test_pdb_set_trace_kwargs(self, pytester: Pytester) -> None:
423 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