Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

debugging pytest in vscode

# launch.json:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Debug Tests",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
            "justMyCode": false
        },
    ]
}
# settings.json
{
    "python.testing.pytestArgs": [
        "--override-ini",
        "addopts=--verbose -vv tests" # <-- this is the directory containing tests.
    ],
    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.pythonPath": "/usr/bin/python" # <-- this is you python env with pytest
}
 
PREVIOUS NEXT
Tagged: #debugging #pytest #vscode
ADD COMMENT
Topic
Name
6+9 =