Debugging test in VS Code does not work
See original GitHub issueEnvironment data
Version: 1.43.1 (user setup) Commit: fe22a9645b44368865c0ba92e2fb881ff1afce94 Date: 2020-03-18T07:01:20.184Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18363
- Python version (& distribution if applicable, e.g. Anaconda): Python Anaconda 3.7.6 64-bit
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): Anaconda 1.9.12
- Relevant/affected Python packages and their versions: Python 2020.3.69010
- Relevant/affected Python-related VS Code extensions and their versions: Python 2020.3.69010
Expected behaviour
Debugging test should work.
Actual behaviour
Debugging test does not work. VS code shows error dialog. See in reproduction steps for more details. If I run the test without debugger the tests runs as expected.
Steps to reproduce:
Try to debug tests using unit test library, Click on the small bug icon for an individual test to debug. I get a dialog box error saying Invalid message: Duplicate entries in “env”. The two options i get are Open launch.json and Cancel.
I have checked my lauch.json and I do not have duplicate entries for any env variable.
Logs
ERR timeout after 500 ms: Error: timeout after 500 ms at t.RawDebugSession.handleErrorResponse (file:///C:/Users/AP/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2954:952) at file:///C:/Users/AP/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2954:250 at async t.RawDebugSession.shutdown (file:///C:/Users/AP/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2952:336)
### Settings.json
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:35 (1 by maintainers)
Top GitHub Comments
@asipras Can you add the following configuration to your
launch.json
:Try debugging your tests, and copy here the content of the
debugpy*.log
file from the extension folder.@lorenzo-cavazzi are you getting the same
Duplicate entries in "env"
message? If that’s the case, there is something else going on in your setup that’s not related to the extension, because it’s a Windows-specific error message from the debugger:https://github.com/microsoft/debugpy/blob/69db68a5f9aff6c1dfd955c8934c753212f94633/src/debugpy/launcher/handlers.py#L110-L119
I am facing the same issue.