Series 19: Testing Your Python Applications
Automated tests document intent, ship refactors confidently, and keep CI honest. This series follows the syllabus in article-plan.md: why tests exist, unittest in depth, pytest ergonomies (markers, fixtures, parametrization), pragmatic TDD, unittest.mock isolation, coverage measurement, plus API-level assertions that reuse your FastAPI knowledge.
Articles
- 145. The importance of testing: unit, integration, and end-to-end tests
- 146. Introduction to unittest (Part 1): Writing basic test cases
- 147. Introduction to unittest (Part 2): Assertions, test discovery, and running tests
- 148. Introduction to pytest (Part 1): Basic tests and markers
- 149. Introduction to pytest (Part 2): Fixtures, parameterized tests, and API clients
- 150. Test-driven development (TDD): Basic principles
- 151. Mocking in tests using unittest.mock
- 152. Code coverage — measuring test effectiveness