Skip to content

Commit 0e5b8ba

Browse files
authored
Merge pull request #6764 from readthedocs/document-pytest-marks
Document usage or pytest marks
2 parents 1b8e006 + d6ee515 commit 0e5b8ba

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/development/tests.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,33 @@ docs
5959
.. _`pyflakes`: https://github.com/pyflakes/pyflakes
6060
.. _`pep8`: https://pep8.readthedocs.io/en/latest/index.html
6161

62+
63+
Pytest marks
64+
------------
65+
66+
The Read the Docs code base is deployed as three instances:
67+
68+
- Main: where you can see the dashboard.
69+
- Build: where the builds happen.
70+
- Serve/proxito: It is in charge of serving the documentation pages.
71+
72+
Each instance has its own settings.
73+
To make sure we test each part as close as possible to its real settings,
74+
we use `pytest marks <https://docs.pytest.org/en/latest/mark.html>`__.
75+
This allow us to run each set of tests with different settings files,
76+
or skip some (like search tests)::
77+
78+
79+
DJANGO_SETTINGS_MODULE=custom.settings.file pytest -m mark
80+
DJANGO_SETTINGS_MODULE=another.settings.file pytest -m "not mark"
81+
82+
Current marks are:
83+
84+
- search (tests that require Elastic Search)
85+
- proxito (tests from the serve/proxito instance)
86+
87+
Tests without mark are from the main instance.
88+
6289
Continuous Integration
6390
----------------------
6491

0 commit comments

Comments
 (0)