Course
Python Testing with pytest
Build Python test suites engineers actually maintain: pytest fixtures, parametrization, honest mocking, property tests, meaningful coverage, and disciplined async and database testing.
Reviews
Enrolled members can rate this course.
No reviews yet.
pytest Foundations
The execution model, fixture design, and parametrization habits that keep tests readable as the suite grows.
- 01The pytest Execution ModelHow pytest collects, injects, and reports tests — and why understanding that model prevents most mysteriously skipped or duplicated tests.20mOpen
- 02Fixtures as Test ArchitectureBuild small composable fixtures, choose scopes deliberately, and avoid fixture pyramids that hide the behavior being tested.24mOpen
- 03Parametrization Without MegatestsUse @pytest.mark.parametrize to turn repetitive tests into case tables while preserving clear names, diffs, and failure isolation.21mOpen
Isolation Without Illusion
Mocks, property-based tests, and coverage interpreted as evidence rather than theater.
- 01Mocking Without Lying to YourselfPatch at the right boundary, assert behavior instead of implementation chatter, and recognize when a fake or integration test is more honest.26mOpen
- 02Property-Based Testing with HypothesisGenerate hostile inputs automatically, state invariants instead of examples, and shrink failures into reproducible regression tests.25mOpen
- 03Coverage That Means SomethingUse line and branch coverage as a missing-test detector, understand what coverage cannot prove, and set thresholds that guide rather than perform.23mOpen
Real Boundaries
Testing async code, databases, and suite architecture that survives production maintenance.
- 01Testing Async PythonUse pytest-asyncio deliberately, test concurrency behavior without sleeping races, and isolate event-loop boundaries with deterministic controls.25mOpen
- 02Testing Database Code HonestlyTest real SQL behavior against real databases, isolate transactions cleanly, and reserve SQLite shortcuts for code that genuinely shares semantics.28mOpen
- 03Designing a Suite People MaintainOrganize unit, integration, and slow tests; choose CI selection deliberately; and keep failure output useful enough that engineers trust the suite.27mOpen