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

Method test_pdb_used_outside_test

testing/test_debugging.py:787–803  ·  testing/test_debugging.py::TestPDB.test_pdb_used_outside_test
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

785 assert class="st">"= 1 passed in" in rest
786
787 def test_pdb_used_outside_test(self, pytester: Pytester) -> None:
788 p1 = pytester.makepyfile(
789 class="st">"""
790 import pytest
791 pytest.set_trace()
792 x = 5
793 class="st">"""
794 )
795 if sys.version_info[:2] >= (3, 13):
796 break_line = class="st">"pytest.set_trace()"
797 else:
798 break_line = class="st">"x = 5"
799 child = pytester.spawn(fclass="st">"{sys.executable} {p1}")
800 child.expect_exact(break_line)
801 child.expect_exact(class="st">"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