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

Function test_run_relative_path

tests/debugpy/test_run.py:52–93  ·  view source on GitHub ↗
(pyfile, run)

Source from the content-addressed store, hash-verified

50
51@pytest.mark.parametrize("run", [runners.launch["internalConsole"]])
52def 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)

Callers

nothing calls this directly

Calls 11

make_relativeMethod · 0.95
open_backchannelMethod · 0.80
set_breakpointsMethod · 0.80
wait_for_stopMethod · 0.80
request_continueMethod · 0.80
receiveMethod · 0.80
wait_for_next_eventMethod · 0.80
proceedMethod · 0.80
runFunction · 0.70
sendMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…