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

Function make_custompy

tests/debugpy/test_run.py:185–203  ·  view source on GitHub ↗
(tmpdir, id="")

Source from the content-addressed store, hash-verified

183
184
185def make_custompy(tmpdir, id=""):
186 if sys.platform == "win32":
187 custompy = tmpdir / ("custompy" + id + ".cmd")
188 script = """@echo off
189 set DEBUGPY_CUSTOM_PYTHON=<id>;%DEBUGPY_CUSTOM_PYTHON%
190 <python> %*
191 """
192 else:
193 custompy = tmpdir / ("custompy" + id + ".sh")
194 script = """#!/bin/sh
195 env "DEBUGPY_CUSTOM_PYTHON=<id>;$DEBUGPY_CUSTOM_PYTHON" <python> "$@"
196 """
197
198 script = script.replace("<id>", id)
199 script = script.replace("<python>", sys.executable)
200 custompy.write(script)
201 os.chmod(custompy.strpath, 0o777)
202
203 return custompy.strpath
204
205
206@pytest.mark.parametrize("run", runners.all_launch)

Callers 2

test_custom_pythonFunction · 0.85
test_custom_python_argsFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…