(pyfile, target, run, jmc)
| 12 | @pytest.mark.parametrize("jmc", ["jmc", ""]) |
| 13 | @pytest.mark.parametrize("target", targets.all_named) |
| 14 | def 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() |
nothing calls this directly
no test coverage detected
searching dependent graphs…