Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: VS Code Testing Activity Support #1501

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading