the wiki of cscosine
pip install pytest
The most reliable way to debug pytest in VS Code is using a launch configuration.
Create or edit:
.vscode/launch.json
and add:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug pytest",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"-s",
# other options you might need
],
"justMyCode": false
}
]
}
If the Testing panel works properly, you can also right-click a test and use:
However, the launch configuration is the most consistent method for full control.