-
Notifications
You must be signed in to change notification settings - Fork 0
Debugging
zeyus edited this page Dec 12, 2022
·
5 revisions
For debugging flask with VSCode, you simply need to add the following debugging configuration to your launch.json:
"configurations": [
{
"name": "NLP4ALL: App",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "nlp4all",
"FLASK_DEBUG": "1"
},
"args": [
"--no-debug",
"run"
],
"jinja": true,
"justMyCode": false
},
...
]
}The "justMyCode": false property can be set to true in order to ignore module code, but note that breakpoints set in module files will not be triggered.
As above, you can easily debug pytest tests by adding the following to your VSCode launch.json
"configurations": [
{
"name": "Debug pytest tests",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-vv",
"-s"
],
"justMyCode": false,
"env": {
"_PYTEST_RAISE": "1"
},
},
...
]
}You can also change the "args" property and add additional args such as "-m", "data" to only run tests marked with the data pytest mark.