(pyfile, long_tmpdir, target, run)
| 18 | |
| 19 | |
| 20 | def test_with_dot_remote_root(pyfile, long_tmpdir, target, run): |
| 21 | @pyfile |
| 22 | def code_to_debug(): |
| 23 | import os |
| 24 | import debuggee |
| 25 | from debuggee import backchannel |
| 26 | |
| 27 | debuggee.setup() |
| 28 | backchannel.send(os.path.abspath(__file__)) |
| 29 | print("done") # @bp |
| 30 | |
| 31 | dir_local = long_tmpdir.mkdir("local") |
| 32 | dir_remote = long_tmpdir.mkdir("remote") |
| 33 | |
| 34 | path_local = dir_local / "code_to_debug.py" |
| 35 | path_remote = dir_remote / "code_to_debug.py" |
| 36 | |
| 37 | code_to_debug.copy(path_local) |
| 38 | code_to_debug.copy(path_remote) |
| 39 | |
| 40 | with debug.Session() as session: |
| 41 | session.config["pathMappings"] = [{"localRoot": dir_local, "remoteRoot": "."}] |
| 42 | |
| 43 | backchannel = session.open_backchannel() |
| 44 | with run(session, target(path_remote), cwd=dir_remote): |
| 45 | # Set breakpoints using local path. This tests that local paths are |
| 46 | # mapped to remote paths. |
| 47 | session.set_breakpoints(path_local, all) |
| 48 | |
| 49 | actual_path_remote = backchannel.receive() |
| 50 | assert some.path(actual_path_remote) == path_remote |
| 51 | |
| 52 | session.wait_for_stop( |
| 53 | "breakpoint", |
| 54 | expected_frames=[some.dap.frame(some.dap.source(path_local), line="bp")], |
| 55 | ) |
| 56 | |
| 57 | session.request_continue() |
| 58 | |
| 59 | |
| 60 | def test_with_path_mappings(pyfile, long_tmpdir, target, run): |
nothing calls this directly
no test coverage detected
searching dependent graphs…