MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_pdb_set_trace_kwargs

Method test_pdb_set_trace_kwargs

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

Source from the content-addressed store, hash-verified

386 self.flush(child)
387
388 def test_pdb_set_trace_kwargs(self, pytester: Pytester) -> None:
389 p1 = pytester.makepyfile(
390 """
391 import pytest
392 def test_1():
393 i = 0
394 print("hello17")
395 pytest.set_trace(header="== my_header ==")
396 x = 3
397 assert 0
398 """
399 )
400 child = pytester.spawn_pytest(str(p1))
401 child.expect("== my_header ==")
402 assert "PDB set_trace" not in child.before.decode()
403 child.expect("Pdb")
404 child.sendline("c")
405 rest = child.read().decode("utf-8")
406 assert "1 failed" in rest
407 assert "def test_1" in rest
408 assert "hello17" in rest # out is captured
409 self.flush(child)
410
411 def test_pdb_set_trace_interception(self, pytester: Pytester) -> None:
412 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