Skip to content

Instantly share code, notes, and snippets.

@Zen-CODE
Last active January 17, 2025 05:51
Show Gist options
  • Select an option

  • Save Zen-CODE/1e9e6182020979d9c789094ecea6ce65 to your computer and use it in GitHub Desktop.

Select an option

Save Zen-CODE/1e9e6182020979d9c789094ecea6ce65 to your computer and use it in GitHub Desktop.
VSCode: launch.json configs
Config for launching a single test in pytest. For all test, just remove the `args` line.
```json
{
"name": "Python: Run single pytest",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": "/home/richard/Repos/dotmodus/remchannel_backend/apps/reports/tests/viewsets/test_survey_reports.py::test_html_and_pdf",
"console": "integratedTerminal",
"justMyCode": true,
}
```
To run a normal python file:
```json
{
"name": "Python: Launch ZenPlayer",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/zenplayer/main.py",
"console": "integratedTerminal",
"justMyCode": false,
"env":{"KIVY_AUDIO": "vlcplayer"}
},
```
To run a command or a binary:
```json
{
"name": "Python: Run uvicorn",
"type": "debugpy",
"request": "launch",
"program": "/home/richard/.pyenv/versions/fastapi_zenlibrary_3.8.10/bin/uvicorn",
"args": ["main:app", "--reload", "--port", "8000"],
"cwd": "${workspaceFolder}/app",
"console": "integratedTerminal"
},
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment