How to Write Tests More Cheaply
summary
Shows how to write tests cheaply and correctly for Python apps by combining unit and integration tests, using pytest and the mocker plugin. Covers application and test architecture that makes integration tests convenient, demonstrates on a real example how pure unit-only or pure integration-only approaches miss bugs, and presents a middle-ground workflow between TDD and ‘write then test’. Also demonstrates deep testing (including base classes), argues high coverage isn’t always good, and promotes developing code alongside tests for balanced quality and cost.
AI-written summary · about
chapters (26)
- 0:00Introduction
- 1:48Why write tests
- 4:20Cheap tests matter
- 6:04Parallel test execution
- 8:13Test structure basics
- 9:18Organizing test data
- 11:45Textures for dependencies
- 13:53Factories vs textures
- 15:43Testing actions properly
- 18:11Meaningful test names
- 20:52Unit vs integration tests
- 24:25Cheap test requirements
- 26:11Summary and Q&A
- 26:33Q&A: Parallel test runs
- 28:22Q&A: Slow integration tests
- 31:34Q&A: Contest structure
- 32:58Q&A: Dynamic test data
- 34:26Q&A: Finding textures
- 36:32Q&A: Factory alternatives
- 39:04Q&A: Parameterized tests
- 40:28Q&A: BDD approach
- 41:33Q&A: Manual data parsing
- 42:16Q&A: Test variability
- 44:45Q&A: Texture organization
- 45:27Q&A: Custom plugins
- 46:15Q&A: Test sequences
