Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 839 Bytes

File metadata and controls

28 lines (22 loc) · 839 Bytes

Development information

VSCode

Debugging

In order to be able to leverage debugging unit tests, the following configuration is needed to be added to launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Unittest",
      "type": "python",
      "request": "launch",
      "program": "${file}",
      "purpose": ["debug-test"],
      "console": "integratedTerminal",
      "env": {"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}"}
    }
  ]
}

This file can be made manually or through the Run & Debug menu option and then clicking on the gear for options.

See also a StackOverflow's issue: how to debug python unittests in Visual Studio Code?