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

Function test_run

tests/debugpy/test_run.py:21–48  ·  view source on GitHub ↗
(pyfile, target, run)

Source from the content-addressed store, hash-verified

19@pytest.mark.parametrize("target", targets.all)
20@pytest.mark.flaky(retries=2, delay=1)
21def test_run(pyfile, target, run):
22 @pyfile
23 def code_to_debug():
24 import os
25 import sys
26
27 import debuggee
28 from debuggee import backchannel
29
30 debuggee.setup()
31 print("begin")
32 backchannel.send(os.path.abspath(sys.modules["debugpy"].__file__))
33 assert backchannel.receive() == "continue"
34 print("end")
35
36 with debug.Session() as session:
37 backchannel = session.open_backchannel()
38 with run(session, target(code_to_debug)):
39 pass
40
41 expected_debugpy_path = os.path.abspath(debugpy.__file__)
42 assert backchannel.receive() == some.str.matching(
43 re.escape(expected_debugpy_path) + r"(c|o)?"
44 )
45
46 backchannel.send("continue")
47 session.wait_for_next_event("terminated")
48 session.proceed()
49
50
51@pytest.mark.parametrize("run", [runners.launch["internalConsole"]])

Callers

nothing calls this directly

Calls 8

open_backchannelMethod · 0.80
receiveMethod · 0.80
matchingMethod · 0.80
wait_for_next_eventMethod · 0.80
proceedMethod · 0.80
runFunction · 0.70
targetFunction · 0.70
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…