Testing with pytest¶
What you'll learn¶
- Test structure and naming
- Assertions and fixtures
- Fast feedback loops
Explanation¶
pytest keeps tests readable and discoverable. Start by testing pure functions,
then move toward integration tests around boundaries (files, DB, network).
Example¶
Run it in the browser:
Common mistakes¶
- Tests that depend on external services without isolation
- Overusing mocks for simple deterministic code