Skip to content

Commit 9ec998c

Browse files
committed
Add testing notes.
pytest-testmon and reversing tests to look for dependencies.
1 parent cb2c034 commit 9ec998c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

doc/developers.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,29 @@ roundup will write each email message that it sends to that file
182182
instead to the internet. This environment variable is independent of
183183
the python -O flag.
184184

185+
Testing Notes
186+
-------------
187+
188+
Create tests for your changes. Also run the tests in reverse to try to
189+
identify test dependencies. You can do this by creating a
190+
``conftest.py`` in the top of the source tree and include the
191+
following contents::
192+
193+
def pytest_collection_modifyitems(items):
194+
items.reverse()
195+
196+
to run all the tests in reverse. More tips at: https://testmon.org/blog/hidden-test-dependencies/.
197+
198+
The full test suite can take a while to run. The `pytest-testmon
199+
<https://pypi.org/project/pytest-testmon/>`_ package can be installed
200+
with pip. It analyzes changes to code and run tests that test that
201+
code. This can significantly reduce the time it takes to run a basic
202+
test suite. Use it by running::
203+
204+
python3 -m pytest -v --testmon test
205+
206+
once over the whole test suite. Then subsequent calls will analyze the
207+
changed files/functions and run tests that cover those changes.
185208

186209
Internationalization Notes
187210
--------------------------

0 commit comments

Comments
 (0)