(pyfile, target, run)
| 19 | @pytest.mark.parametrize("target", targets.all) |
| 20 | @pytest.mark.flaky(retries=2, delay=1) |
| 21 | def 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"]]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…