Skip to content

Commit

Permalink
chore: add basic conf for pytest debug in VS Code
Browse files Browse the repository at this point in the history
Adding a configuration that allowed me to debug one of the tests via MS Python extension in VS Code (extension now included among suggested).

Sourced from here: microsoft/vscode-python#10722 (comment)

This seemed to be needed to get around an issue where an error dialog was shown while trying to debug tests (slong the lines of "invalid message found duplicate in env path")

Note that I'm on a very recent version of VS Code (early August 2023), so this might not work on older versions.
  • Loading branch information
AndrewADev committed Aug 20, 2023
1 parent 09d82d3 commit d2c57f8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,3 @@ dmypy.json

# Pyre type checker
.pyre/

# Presently ignoring, as only contains a non-portable path
.vscode/
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-python.python"
]
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Pytest",
"type": "python",
"request": "test",
"console": "integratedTerminal"
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"test"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}

0 comments on commit d2c57f8

Please sign in to comment.