Created
February 28, 2024 09:58
-
-
Save gustavz/d49251be196a21338d23068a0200d811 to your computer and use it in GitHub Desktop.
VS Code debug pytest current file and test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Current File", | |
"type": "python", | |
"request": "launch", | |
"program": "${file}", | |
"console": "integratedTerminal", | |
"cwd": "${fileDirname}", | |
"env": { | |
"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}" | |
} | |
}, | |
{ | |
"name": "Pytest: Current File", | |
"type": "python", | |
"request": "launch", | |
"module": "pytest", | |
"args": [ | |
"${file}" | |
], | |
"env": { | |
"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}" | |
}, | |
"console": "integratedTerminal" | |
}, | |
{ | |
"name": "Pytest: Current Test", | |
"type": "python", | |
"request": "launch", | |
"module": "pytest", | |
"args": [ | |
"${file}::${selectedText}" | |
], | |
"env": { | |
"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}" | |
}, | |
"console": "integratedTerminal" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment