In my Python project, I'm using Pytest. The directory structure is:
src/
docs/
test/
I have a different kind of tests:
- normal tests, in
test/* - doctests in the source,
src/* - doctests in documentation,
docs/*.rst(Sphinx)
I'd like to run all of them at once, so I can aggregate statistics on all of them (e.g. coverage).
- For 1. : just
pytest - For 2. :
pytest --doctest-modules src - For 3. :
pytest --doctest-glob="docs/*.rst" docs
I managed to run pairs of them:
- For 1-2:
pytest --doctest-modules src test - For 1-3:
pytest --doctest-glob="docs/source/*.rst"
How to run all of them in one single command? Maybe the problem is simpler than I think...