The following is a collection of Python posts I have written:
- Giving and Receiving Great Feedback through PRs: best practises when giving and receiving feedback to get the most out of reviews whilst avoiding comment wars
- Writing Great Docstrings: when, how and why to write docstrings for modules, classes and functions, including linters to check your documentation
- Writing Great Test Documentation: how to document tests using the arrange/ act/ assert pattern, including a linter to check your documentation
- Is This Code Worth Testing? Discusses a few code examples and whether they are worth covering with unit, integration and end-to-end tests.
- Should this code be in the test or a fixture? Discusses whether setup code should be in a test or a fixture by going through a few examples
- Navigating Mocks in Python: Strategies for Safe and Efficient Mock Usage: the benefits and risks of using mocks, designing interfaces that are reasonable to mock and a mocking safety feature in Python
- Reduce Duplication in Pytest Parametrised Tests using the Walrus Operator: method for reducing test data duplication using the walrus operator
- Help Your Users fix your Errors: improve the way you raise errors by pointing your users directly to your documentation specifically for each error, including a linter to check how you raise errors
- Python TypedDict Arbitrary Key Names with Totality: writing type hints for dictionaries with arbitrary keys