(
pyfile, tmpdir, run, target, debuggee_custompy, launcher_custompy
)
| 207 | @pytest.mark.parametrize("debuggee_custompy", [None, "launcher"]) |
| 208 | @pytest.mark.parametrize("launcher_custompy", [None, "debuggee"]) |
| 209 | def test_custom_python( |
| 210 | pyfile, tmpdir, run, target, debuggee_custompy, launcher_custompy |
| 211 | ): |
| 212 | @pyfile |
| 213 | def code_to_debug(): |
| 214 | import os |
| 215 | |
| 216 | import debuggee |
| 217 | from debuggee import backchannel |
| 218 | |
| 219 | debuggee.setup() |
| 220 | backchannel.send(os.getenv("DEBUGPY_CUSTOM_PYTHON")) |
| 221 | |
| 222 | expected = "" |
| 223 | if debuggee_custompy: |
| 224 | debuggee_custompy = make_custompy(tmpdir, "debuggee") |
| 225 | expected += "debuggee;" |
| 226 | if launcher_custompy: |
| 227 | launcher_custompy = make_custompy(tmpdir, "launcher") |
| 228 | expected += "launcher;" |
| 229 | else: |
| 230 | # If "python" is set, it also becomes the default for "debugLauncherPython" |
| 231 | expected *= 2 |
| 232 | if not len(expected): |
| 233 | pytest.skip() |
| 234 | |
| 235 | with debug.Session() as session: |
| 236 | session.config.pop("python", None) |
| 237 | if launcher_custompy: |
| 238 | session.config["debugLauncherPython"] = launcher_custompy |
| 239 | if debuggee_custompy: |
| 240 | session.config["python"] = debuggee_custompy |
| 241 | |
| 242 | backchannel = session.open_backchannel() |
| 243 | with run(session, target(code_to_debug)): |
| 244 | pass |
| 245 | |
| 246 | assert backchannel.receive() == expected |
| 247 | |
| 248 | |
| 249 | @pytest.mark.parametrize("run", runners.all_launch) |
nothing calls this directly
no test coverage detected
searching dependent graphs…