Mercurial > p > roundup > code
diff doc/developers.txt @ 7475:3ff266644794
Add testing notes.
pytest-testmon and reversing tests to look for dependencies.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 08 Jun 2023 21:54:38 -0400 |
| parents | 623502678b97 |
| children | 3134415ffb8a |
line wrap: on
line diff
--- a/doc/developers.txt Thu Jun 08 20:38:29 2023 -0400 +++ b/doc/developers.txt Thu Jun 08 21:54:38 2023 -0400 @@ -182,6 +182,29 @@ instead to the internet. This environment variable is independent of the python -O flag. +Testing Notes +------------- + +Create tests for your changes. Also run the tests in reverse to try to +identify test dependencies. You can do this by creating a +``conftest.py`` in the top of the source tree and include the +following contents:: + + def pytest_collection_modifyitems(items): + items.reverse() + +to run all the tests in reverse. More tips at: https://testmon.org/blog/hidden-test-dependencies/. + +The full test suite can take a while to run. The `pytest-testmon +<https://pypi.org/project/pytest-testmon/>`_ package can be installed +with pip. It analyzes changes to code and run tests that test that +code. This can significantly reduce the time it takes to run a basic +test suite. Use it by running:: + + python3 -m pytest -v --testmon test + +once over the whole test suite. Then subsequent calls will analyze the +changed files/functions and run tests that cover those changes. Internationalization Notes --------------------------
