Skip to content

Commit 4b9e92b

Browse files
jmbowmanJeremy Bowman
authored andcommitted
Update Pycharm test setup docs for pytest
1 parent 14f803f commit 4b9e92b

1 file changed

Lines changed: 13 additions & 20 deletions

File tree

docs/pycharm_integration.rst

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -197,34 +197,27 @@ configuration with the following options:
197197
Setup a Run/Debug Configuration for python tests for LMS or Studio
198198
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199199

200-
To run and debug unit tests, create a **"Django server"** type Run/Dubug
201-
configuration (not "Django tests" as is done for IDAs) with the following
202-
options:
203-
204-
1. Leave host/port blank
205-
206-
2. Additional Options: test lms/djangoapps/courseware/tests/test_views.py:TestJumpTo.test_jumpto_id
207-
208-
3. Check "Custom run command:" and enter either ``lms`` or ``cms`` in to the text box.
209-
210-
4. Environment Variables:
211-
212-
- DJANGO_SETTINGS_MODULE=**lms.envs.test** (or
213-
cms.envs.test)
214-
- DISABLE_MIGRATIONS=1
215-
- PYTHONUNBUFFERED=1
200+
To run and debug unit tests, edit the **"Defaults -> Python tests -> py.test"** type Run/Dubug
201+
configuration with the following options:
216202

217-
5. Python Interpreter: Choose the Docker Compose interpreter for this
203+
1. Python Interpreter: Choose the Docker Compose interpreter for this
218204
service.
219205

220-
6. Working directory: /edx/app/edxapp/edx-platform
206+
2. Working directory: /edx/app/edxapp/edx-platform
221207

222-
7. Path mappings (add mapping):
208+
3. Path mappings (add mapping):
223209

224210
- Local path: LOCAL/PATH/TO/edx-platform (e.g. ~/edx/edx-platform)
225211
- Remote path: /edx/app/edxapp/edx-platform
226212

227-
8. Deselect "Add content..." and "Add source..."
213+
4. Deselect "Add content..." and "Add source..."
214+
215+
Then set the "Tools -> Python Integrated Tools -> Default test runner"
216+
preference to "py.test", apply the change, and restart PyCharm. You should
217+
now be able to execute any individual test file via its context menu, or to
218+
run custom sets of tests by creating a custom py.test Run/Debug configuration
219+
(which should now be initialized with the defaults above) and setting its
220+
"Target" appropriately.
228221

229222
Currently not supported for PyCharm Development
230223
-----------------------------------------------

0 commit comments

Comments
 (0)