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

Method test_pdb_used_outside_test

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

Source from the content-addressed store, hash-verified

785 assert "= 1 passed in" in rest
786
787 def test_pdb_used_outside_test(self, pytester: Pytester) -> None:
788 p1 = pytester.makepyfile(
789 """
790 import pytest
791 pytest.set_trace()
792 x = 5
793 """
794 )
795 if sys.version_info[:2] >= (3, 13):
796 break_line = "pytest.set_trace()"
797 else:
798 break_line = "x = 5"
799 child = pytester.spawn(f"{sys.executable} {p1}")
800 child.expect_exact(break_line)
801 child.expect_exact("Pdb")
802 child.sendeof()
803 self.flush(child)
804
805 def test_pdb_used_in_generate_tests(self, pytester: Pytester) -> None:
806 p1 = pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

flushMethod · 0.95
makepyfileMethod · 0.45
spawnMethod · 0.45

Tested by

no test coverage detected