Skip to content

Commit e34819a

Browse files
authored
feat: VS Code Testing Activity Support (#1501)
1 parent 610177e commit e34819a

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# required for vscode testing activity to discover tests
2+
DJANGO_SETTINGS_MODULE=tests.settings

.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"tests",
4+
"--no-cov"
5+
],
6+
"python.testing.unittestEnabled": false,
7+
"python.testing.pytestEnabled": true
8+
}

docs/contributing.rst

+21
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,27 @@ In test code, anywhere the database is referenced the Django router needs to be
272272
273273
Without the 'using' option, this test fails in the multiple database scenario because 'default' will be used instead.
274274

275+
Debugging the Tests Interactively
276+
---------------------------------
277+
278+
Interactive Debugging allows you to set breakpoints and inspect the state of the program at runtime. We strongly
279+
recommend using an interactive debugger to streamline your development process.
280+
281+
VS Code
282+
^^^^^^^
283+
284+
VS Code is a popular IDE that supports debugging Python code. You can debug the tests interactively in VS Code by
285+
following these steps:
286+
287+
.. code-block:: bash
288+
289+
pip install .[dev]
290+
# open the project in VS Code
291+
# click Testing (erlenmeyer flask) on the Activity Bar
292+
# select the test you want to run or debug
293+
294+
295+
275296
Code conventions matter
276297
-----------------------
277298

pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ dependencies = [
4040
"jwcrypto >= 1.5.0",
4141
]
4242

43+
[project.optional-dependencies]
44+
dev = [
45+
"pytest",
46+
"pytest-cov",
47+
"m2r",
48+
"sphinx-rtd-theme",
49+
]
50+
4351
[project.urls]
4452
Homepage = "https://django-oauth-toolkit.readthedocs.io/"
4553
Repository = "https://github.com/jazzband/django-oauth-toolkit"

0 commit comments

Comments
 (0)