sphinxcontrib-towncrier
sphinxcontrib-towncrier copied to clipboard
Add testing infrastructure
trafficstars
- [x] Configure pytest with a few essential plugins. e.g. https://github.com/ansible/pylibssh/blob/830218bf59c10e0a265638943878c3b13d46ca1d/pytest.ini
- [x] Set up tox to run pytest allowing to pass extra args via
{posargs}. e.g. https://github.com/ansible/pylibssh/blob/830218bf59c10e0a265638943878c3b13d46ca1d/tox.ini#L11-L43 - [x] Add a very basic test infra. e.g. https://github.com/ansible/pylibssh/blob/830218bf59c10e0a265638943878c3b13d46ca1d/tests/unit/version_test.py#L15-L17
Pro tip: Start with just one test function having only
assert True. This will allow you to check that you've configured all of the other bits correctly. Your goal is to see this test in the report and have it green. - [x] Add a GHA workflow for running the tests. e.g. https://github.com/ansible/pylibssh/blob/830218bf59c10e0a265638943878c3b13d46ca1d/.github/workflows/build-test-n-publish.yml#L656
Start small, with one job. Then, extend it to be a matrix across different Python versions (as specified in
setup.cfg) and OSs. - [x] Finally, add a few unit tests for helper functions in the extension.
- [ ] Add heavier integration tests too.
- [ ] Integrate
sphinx.testing.fixtures: https://www.sphinx-doc.org/en/master/extdev/testing.html