You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the "Debug Test" functionality in VSCode with Python, I am unable to get the debugger to attach to subprocesses spawned during the tests. I've set "subProcess": true in my launch.json file and included "purpose": ["debug-test"], which seems like what I am suppose dto do to configure "debug test" launches... but this doesn't seem to have any effect -- the debugger still doesn't attach to subprocesses.
Additionally, I have tried to use the "connect" option to attach to an existing process, but VSCode doesn't allow the "connect" attribute at all when "purpose" includes "debug-test".
I've prepared a simple project to demonstrate the issue:
The test suite starts a subprocess that needs to be debugged
Although I would also like to (and prefer to) be able to attach to an already running subprocess to save startup time when iterating on test code vs application code
The launch.json configuration includes "subProcess": true, but subprocess debugging doesn't work during "Debug Test" runs
vscode does not allow "connect" when "purpose": ["debug-test"] is set, limiting this option as well
What I'm hoping for here:
Guidance on how to enable subprocess debugging when running tests with "Debug Test".
i.e. am I just doing this wrong?
Clarification on whether this is a limitation of the current debugger implementation.
i.e. is this just not possible?
Suggestions for workarounds to debug subprocesses in tests
e.g. I am considering running two vscode instances, one that debugs the server, an da second that debugs the tests... but this is obviously not-ideal
The text was updated successfully, but these errors were encountered:
Hi! If I understand correctly you are running tests, these tests run a subprocess, you are attempting to attach to this subprocess? Since you are just attaching to this subprocess, I don't think you will need the type to be "purpose": ["debug-test"]. Instead you should just be able to attach a listener to the correct port, kinda like this configuration:
When using the "Debug Test" functionality in VSCode with Python, I am unable to get the debugger to attach to subprocesses spawned during the tests. I've set
"subProcess": true
in mylaunch.json
file and included"purpose": ["debug-test"]
, which seems like what I am suppose dto do to configure "debug test" launches... but this doesn't seem to have any effect -- the debugger still doesn't attach to subprocesses.Additionally, I have tried to use the "connect" option to attach to an existing process, but VSCode doesn't allow the "connect" attribute at all when "purpose" includes "debug-test".
I've prepared a simple project to demonstrate the issue:
https://github.com/rwarren/DEMO_vscode_subprocess_debug
Details:
"subProcess": true
, but subprocess debugging doesn't work during "Debug Test" runs"purpose": ["debug-test"]
is set, limiting this option as wellWhat I'm hoping for here:
The text was updated successfully, but these errors were encountered: