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

Function test_justmycode_frames

tests/debugpy/test_justmycode.py:14–51  ·  view source on GitHub ↗
(pyfile, target, run, jmc)

Source from the content-addressed store, hash-verified

12@pytest.mark.parametrize("jmc", ["jmc", ""])
13@pytest.mark.parametrize("target", targets.all_named)
14def test_justmycode_frames(pyfile, target, run, jmc):
15 @pyfile
16 def code_to_debug():
17 import debuggee
18
19 debuggee.setup()
20
21 import this # @bp
22
23 assert this
24
25 with debug.Session() as session:
26 session.config["justMyCode"] = bool(jmc)
27
28 with run(session, target(code_to_debug)):
29 session.set_breakpoints(code_to_debug, all)
30
31 stop = session.wait_for_stop(
32 "breakpoint", expected_frames=[some.dap.frame(code_to_debug, "bp")]
33 )
34 if jmc:
35 assert len(stop.frames) == 1
36 else:
37 assert len(stop.frames) >= 1
38
39 session.request("stepIn", {"threadId": stop.thread_id})
40
41 # With JMC, it should step out of the function, remaining in the same file.
42 # Without JMC, it should step into stdlib.
43 expected_path = some.path(code_to_debug)
44 if not jmc:
45 expected_path = ~expected_path
46 session.wait_for_stop(
47 "step",
48 expected_frames=[some.dap.frame(some.dap.source(expected_path), some.int)],
49 )
50
51 session.request_continue()

Callers

nothing calls this directly

Calls 8

set_breakpointsMethod · 0.80
wait_for_stopMethod · 0.80
pathMethod · 0.80
request_continueMethod · 0.80
runFunction · 0.70
targetFunction · 0.70
requestMethod · 0.45
sourceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…