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
{{ message }}
Repository navigation
Debugging a test does not work in Testing tab #17399
I literally replicated what you have, and it seems to be working fine. Try enabling logs to see if something comes up. You can do this by setting logToFile true in the launch json.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Test config",
"type": "python",
"request": "launch",
"purpose": ["debug-test"],
"logToFile": true,
}
]
}
Then start debugging using test explorer. Logs should in the extension folder (~/.vscode/extensions/ms-python.python-2021.9.1230869389) with the name debugpy*.log. Please share them.
The above config can only be used with tests and cannot be used to debug files using the play button. If you want to debug files using the play button, you can either use the debug button at the top of the file, or add a python file debug configuration in addition to the test config. Like this:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Test config",
"type": "python",
"request": "launch",
"purpose": ["debug-test"],
"logToFile": true
}
]
}
Could the problem be that I am in a remote ssh session?
I activated the logs as you proposed, but the remote machine (Ubuntu 20.04) .vsode home folder only shows a settings.json file.
The local machine does not show any debugpy*.log files either in my home folder (Windows).
Can you try to repro in a remote machine? Otherwise, it seems that the debugging does not even start in my remote :S.
I tested this on ssh remote, it seems to be working there too. So I suspect debugger is somehow failing. The logs for ssh scenario will be under ~/.vscode-server/extensions/ms-python.python-2021.9.1230869389 or if you open Output > Python you should see path to the extension when we run linter or formatter or internal scripts to discover tests there. Just follow that path to the extension directory.
Apparently it seems to be working fine now, I don't know what has changed.
It is now working in the MWE and in my original repo too, so I cannot repro in either :S
Thanks a lot for your help, I will close this now, and reopen if it happens again.
Activity
karthiknadig commentedon Sep 14, 2021
I am not able to repro this.

I literally replicated what you have, and it seems to be working fine. Try enabling logs to see if something comes up. You can do this by setting
logToFiletrue in the launch json.Then start debugging using test explorer. Logs should in the extension folder (~/.vscode/extensions/ms-python.python-2021.9.1230869389) with the name
debugpy*.log. Please share them.The above config can only be used with tests and cannot be used to debug files using the play button. If you want to debug files using the play button, you can either use the debug button at the top of the file, or add a
python filedebug configuration in addition to the test config. Like this:jzazo commentedon Sep 15, 2021
Could the problem be that I am in a remote ssh session?
I activated the logs as you proposed, but the remote machine (Ubuntu 20.04) .vsode home folder only shows a
settings.jsonfile.The local machine does not show any
debugpy*.logfiles either in my home folder (Windows).Can you try to repro in a remote machine? Otherwise, it seems that the debugging does not even start in my remote :S.
karthiknadig commentedon Sep 15, 2021
I tested this on ssh remote, it seems to be working there too. So I suspect debugger is somehow failing. The logs for ssh scenario will be under
~/.vscode-server/extensions/ms-python.python-2021.9.1230869389or if you open Output > Python you should see path to the extension when we run linter or formatter or internal scripts to discover tests there. Just follow that path to the extension directory.jzazo commentedon Sep 15, 2021
Apparently it seems to be working fine now, I don't know what has changed.
It is now working in the MWE and in my original repo too, so I cannot repro in either :S
Thanks a lot for your help, I will close this now, and reopen if it happens again.
ericchansen commentedon Sep 21, 2021
For me, I had to include "version": "0.2.0" in my launch.json to get it working. That isn't included in the automatically generated launch.json.