Skip to content

Commit 25a2d1f

Browse files
committed
temp: use example files
1 parent 57d8b49 commit 25a2d1f

5 files changed

Lines changed: 47 additions & 9 deletions

File tree

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ venv/
7070
### Visual Studio Code ###
7171
# Generally ignore VS Code configuration, except...
7272
.vscode/*
73-
# included for test settings, so VS Code's Testing bar works out of the box
74-
!.vscode/settings.json
73+
# Example settings to let people quickly get up to speed with testing.
74+
!.vscode/launch.json.example
75+
!.vscode/settings.json.example
7576

7677
# Media files (for uploads)
7778
media/

.vscode/launch.json.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Debug Tests",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${file}",
12+
"purpose": ["debug-test"],
13+
"console": "integratedTerminal",
14+
"justMyCode": false,
15+
16+
// This is needed because pytest-cov is incompatible with using the
17+
// debugger. See https://code.visualstudio.com/docs/python/testing#_pytest-configuration-settings
18+
"env": {"PYTEST_ADDOPTS": "--no-cov"}
19+
}
20+
]
21+
}

.vscode/settings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.vscode/settings.json.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"python.testing.unittestEnabled": false,
3+
"python.testing.pytestEnabled": true,
4+
"python.testing.pytestArgs": [
5+
// We have to override this here instead of in pytest.ini because tutor
6+
// sets the DJANGO_SETTINGS_MODULE env variable in our container to be
7+
// the one for LMS or Studio, and that takes precedence over any value
8+
// set in pytest.ini. The only thing that takes higher precedence than
9+
// the env variable is the explicit command line parameter:
10+
//
11+
// https://pytest-django.readthedocs.io/en/stable/configuring_django.html#order-of-choosing-settings
12+
"--ds=test_settings"
13+
],
14+
}

README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ Every time you develop something in this repo
108108
109109
# Open a PR and ask for review.
110110
111+
Configuring Visual Studio Code
112+
------------------------------
113+
114+
If you are using VS Code as your editor, you can enable the Testing bar by copying from the example configuration provided in the ``.vscode`` directory::
115+
116+
cd .vscode/
117+
cp launch.json.example launch.json
118+
cp settings.json.example settings.json
119+
111120
License
112121
-------
113122

0 commit comments

Comments
 (0)