profile
viewpoint

Ask questionsUnable to debug Python tests (duplicate entries in "env")

Python: 3.7.5 VSCode: 1.43.2 Pytest: 5.4.1 Using virtual env.

Whenever I press "Debug All Tests" button I get the message: Invalid message: Duplicate entries in "env". image

My launch.json file:

{ "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal" } ] }

The same thing happens if I try to debug any particular failed test. Looking forward to your help!

microsoft/vscode-python

Answer questions karthiknadig

Dupe of #10722

Try with this:

{
"name": "Python: Current File",
"type": "python",
"request": "test",  // <----- this is for tests
"console": "integratedTerminal"
}
useful!
source:https://uonfu.com/
answerer
Karthik Nadig karthiknadig @Microsoft Redmond Developer at Microsoft, working on VS Code Python and Python Debugger.
Github User Rank List