(pyfile, run)
| 50 | |
| 51 | @pytest.mark.parametrize("run", [runners.launch["internalConsole"]]) |
| 52 | def test_run_relative_path(pyfile, run): |
| 53 | @pyfile |
| 54 | def code_to_debug(): |
| 55 | import debuggee |
| 56 | from debuggee import backchannel |
| 57 | from _pydev_bundle.pydev_log import list_log_files |
| 58 | |
| 59 | debuggee.setup() |
| 60 | from _pydevd_bundle import pydevd_constants # @ bp1 |
| 61 | |
| 62 | backchannel.send( |
| 63 | list_log_files(pydevd_constants.DebugInfoHolder.PYDEVD_DEBUG_FILE) |
| 64 | ) |
| 65 | assert backchannel.receive() == "continue" |
| 66 | |
| 67 | with debug.Session() as session: |
| 68 | backchannel = session.open_backchannel() |
| 69 | code_to_debug = str(code_to_debug) |
| 70 | cwd = os.path.dirname(os.path.dirname(code_to_debug)) |
| 71 | |
| 72 | program = targets.Program(code_to_debug) |
| 73 | program.make_relative(cwd) |
| 74 | with run(session, program): |
| 75 | session.set_breakpoints(code_to_debug, all) |
| 76 | |
| 77 | session.wait_for_stop() |
| 78 | session.request_continue() |
| 79 | |
| 80 | pydevd_debug_files = backchannel.receive() |
| 81 | backchannel.send("continue") |
| 82 | session.wait_for_next_event("terminated") |
| 83 | session.proceed() |
| 84 | |
| 85 | # Check if we don't have errors in the pydevd log (the |
| 86 | # particular error this test is covering: |
| 87 | # https://github.com/microsoft/debugpy/issues/620 |
| 88 | # is handled by pydevd but produces a Traceback in the logs). |
| 89 | for pydevd_debug_file in pydevd_debug_files: |
| 90 | with open(pydevd_debug_file, "r") as stream: |
| 91 | contents = stream.read() |
| 92 | |
| 93 | assert "FileNotFound" not in contents |
| 94 | |
| 95 | |
| 96 | @pytest.mark.parametrize("run", runners.all_launch) |
nothing calls this directly
no test coverage detected
searching dependent graphs…