MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_pdb_set_trace_kwargs

Method test_pdb_set_trace_kwargs

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

Source from the content-addressed store, hash-verified

420 self.flush(child)
421
422 def test_pdb_set_trace_kwargs(self, pytester: Pytester) -> None:
423 p1 = pytester.makepyfile(
424 """
425 import pytest
426 def test_1():
427 i = 0
428 print("hello17")
429 pytest.set_trace(header="== my_header ==")
430 x = 3
431 assert 0
432 """
433 )
434 child = pytester.spawn_pytest(str(p1))
435 child.expect("== my_header ==")
436 assert "PDB set_trace" not in child.before.decode()
437 child.expect("Pdb")
438 child.sendline("c")
439 rest = child.read().decode("utf-8")
440 assert "1 failed" in rest
441 assert "def test_1" in rest
442 assert "hello17" in rest # out is captured
443 self.flush(child)
444
445 def test_pdb_set_trace_interception(self, pytester: Pytester) -> None:
446 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