MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / _attach_to_writer_pid

Function _attach_to_writer_pid

tests_python/test_debugger_json.py:5184–5210  ·  view source on GitHub ↗
(writer)

Source from the content-addressed store, hash-verified

5182
5183
5184def _attach_to_writer_pid(writer):
5185 import pydevd
5186 import threading
5187 import subprocess
5188
5189 assert writer.process is not None
5190
5191 def attach():
5192 attach_pydevd_file = os.path.join(os.path.dirname(pydevd.__file__), "pydevd_attach_to_process", "attach_pydevd.py")
5193 subprocess.call(
5194 [
5195 sys.executable,
5196 attach_pydevd_file,
5197 "--pid",
5198 str(writer.process.pid),
5199 "--port",
5200 str(writer.port),
5201 "--protocol",
5202 "http_json",
5203 "--debug-mode",
5204 "debugpy-dap",
5205 ]
5206 )
5207
5208 threading.Thread(target=attach).start()
5209
5210 wait_for_condition(lambda: writer.finished_initialization)
5211
5212
5213@pytest.mark.parametrize("reattach", [True, False])

Calls 2

wait_for_conditionFunction · 0.90
startMethod · 0.45

Tested by

no test coverage detected