These can be used as pre-commit tests or as part of a broader testing strategy.
While I consider these examples to be sane, there are a plethora of additional options available. I'm still using the pytest
library. But this should still work when using the unittest
module now part of the standard library.
I've also kept these reasonably quiet and only checking for the most egregious problems.
The assumption is that we're using Poetry as a builder.
Additionally, the output from these tests will be saved as a JUnit XML file for future parsing.
We'll be testing for:
- Code coverage - Coverage
- Type checks - MyPy
- PEP-8 style - Style Guide
- Code complexity - xenon and radon
- Docstring coverage - interrogate
This is a pretty bare bones set of examples. The actual implementation will vary. Please don't simply copy and paste.