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

Method test_trace_sets_breakpoint

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

Source from the content-addressed store, hash-verified

1049
1050class TestTraceOption:
1051 def test_trace_sets_breakpoint(self, pytester: Pytester) -> None:
1052 p1 = pytester.makepyfile(
1053 """
1054 def test_1():
1055 assert True
1056
1057 def test_2():
1058 pass
1059
1060 def test_3():
1061 pass
1062 """
1063 )
1064 child = pytester.spawn_pytest("--trace " + str(p1))
1065 child.expect("test_1")
1066 child.expect("Pdb")
1067 child.sendline("c")
1068 child.expect("test_2")
1069 child.expect("Pdb")
1070 child.sendline("c")
1071 child.expect("test_3")
1072 child.expect("Pdb")
1073 child.sendline("q")
1074 child.expect_exact("Exit: Quitting debugger")
1075 rest = child.read().decode("utf8")
1076 assert "= 2 passed in" in rest
1077 assert "reading from stdin while output" not in rest
1078 # Only printed once - not on stderr.
1079 assert "Exit: Quitting debugger" not in child.before.decode("utf8")
1080 TestPDB.flush(child)
1081
1082 def test_trace_with_parametrize_handles_shared_fixtureinfo(
1083 self, pytester: Pytester

Callers

nothing calls this directly

Calls 4

makepyfileMethod · 0.45
spawn_pytestMethod · 0.45
readMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected