Skip to content

Commit

Permalink
feat: VS Code Testing Activity Support (#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
dopry authored Sep 20, 2024
1 parent 610177e commit e34819a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# required for vscode testing activity to discover tests
DJANGO_SETTINGS_MODULE=tests.settings
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"python.testing.pytestArgs": [
"tests",
"--no-cov"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
21 changes: 21 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,27 @@ In test code, anywhere the database is referenced the Django router needs to be
Without the 'using' option, this test fails in the multiple database scenario because 'default' will be used instead.

Debugging the Tests Interactively
---------------------------------

Interactive Debugging allows you to set breakpoints and inspect the state of the program at runtime. We strongly
recommend using an interactive debugger to streamline your development process.

VS Code
^^^^^^^

VS Code is a popular IDE that supports debugging Python code. You can debug the tests interactively in VS Code by
following these steps:

.. code-block:: bash
pip install .[dev]
# open the project in VS Code
# click Testing (erlenmeyer flask) on the Activity Bar
# select the test you want to run or debug
Code conventions matter
-----------------------

Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ dependencies = [
"jwcrypto >= 1.5.0",
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"m2r",
"sphinx-rtd-theme",
]

[project.urls]
Homepage = "https://django-oauth-toolkit.readthedocs.io/"
Repository = "https://github.com/jazzband/django-oauth-toolkit"
Expand Down

0 comments on commit e34819a

Please sign in to comment.