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

Method test_pdb_interaction_capturing_simple

testing/test_debugging.py:398–420  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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