Skip to content

Commit

Permalink
Vscode debugging (#807)
Browse files Browse the repository at this point in the history
* Make it possible to debug pytest unit tests via vs code. I needed to set up a purpose in the launch.json.
* Share settings about auto-formatting that is workspace specific.
  • Loading branch information
deltamarnix authored Mar 4, 2024
1 parent ad8b0a5 commit 9869e06
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ venv.bak/
.spyderproject
.spyproject

# VScode
.vscode

# PyCharm
.idea

Expand Down
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"ms-python.python",
"ms-python.debugpy",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"njpwerner.autodocstring"
]
}
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"purpose": ["debug-test"]
}
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
},
"editor.formatOnSave": true
}

0 comments on commit 9869e06

Please sign in to comment.