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

Method test_pdb_set_trace_kwargs

testing/test_debugging.py:422–443  ·  testing/test_debugging.py::TestPDB.test_pdb_set_trace_kwargs
(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 class="st">"""
425 import pytest
426 def test_1():
427 i = 0
428 print(class="st">"hello17")
429 pytest.set_trace(header=class="st">"== my_header ==")
430 x = 3
431 assert 0
432 class="st">"""
433 )
434 child = pytester.spawn_pytest(str(p1))
435 child.expect(class="st">"== my_header ==")
436 assert class="st">"PDB set_trace" not in child.before.decode()
437 child.expect(class="st">"Pdb")
438 child.sendline(class="st">"c")
439 rest = child.read().decode(class="st">"utf-8")
440 assert class="st">"1 failed" in rest
441 assert class="st">"def test_1" in rest
442 assert class="st">"hello17" in rest class="cm"># 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