MCPcopy Create free account
hub / github.com/microsoft/debugpy / test_stop_on_entry

Function test_stop_on_entry

tests/debugpy/test_stop_on_entry.py:15–44  ·  view source on GitHub ↗
(pyfile, run, target, breakpoint)

Source from the content-addressed store, hash-verified

13@pytest.mark.parametrize("run", runners.all_launch)
14@pytest.mark.parametrize("target", targets.all_named)
15def test_stop_on_entry(pyfile, run, target, breakpoint):
16 @pyfile
17 def code_to_debug():
18 from debuggee import backchannel # @bp
19
20 backchannel.send("done")
21
22 with debug.Session() as session:
23 session.config["stopOnEntry"] = True
24
25 backchannel = session.open_backchannel()
26 with run(session, target(code_to_debug)):
27 if breakpoint:
28 session.set_breakpoints(code_to_debug, all)
29
30 if breakpoint:
31 stop = session.wait_for_stop(
32 "breakpoint", expected_frames=[some.dap.frame(code_to_debug, "bp")]
33 )
34 session.request("next", {"threadId": stop.thread_id})
35 stop = session.wait_for_stop(
36 "step", expected_frames=[some.dap.frame(code_to_debug, 3)]
37 )
38 else:
39 session.wait_for_stop(
40 "entry", expected_frames=[some.dap.frame(code_to_debug, 1)]
41 )
42
43 session.request_continue()
44 assert backchannel.receive() == "done"

Callers

nothing calls this directly

Calls 8

open_backchannelMethod · 0.80
set_breakpointsMethod · 0.80
wait_for_stopMethod · 0.80
request_continueMethod · 0.80
receiveMethod · 0.80
runFunction · 0.70
targetFunction · 0.70
requestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…