Python · Section 14
Testing
The test pyramid, pytest's fixtures/parametrization/marks, unittest.mock's Mock/patch/AsyncMock, and the quality practices — coverage, isolation, determinism — that decide whether a test suite can actually be trusted. The roadmap calls testing "a major competency at this level."
This section
- Test typesThe test pyramid — unit, integration, API, and end-to-end tests — plus three more specialized types: regression, contract, and performance tests.1 core1 standard2 concepts
- pytestDiscovery and plain-assert assertions, fixtures and their scopes, parametrization, marks and plugins, and async tests via conftest.py-shared configuration.2 core3 standard5 concepts
- Mockingunittest.mock's Mock, MagicMock, patch, and AsyncMock; monkeypatching; the vocabulary of test doubles (stubs, spies, fakes); and the roadmap's own "most importantly" rule — knowing what should and should not be mocked.3 core2 standard5 concepts
- QualityWhat makes a test suite trustworthy beyond "the tests pass" — coverage, isolation, determinism, database/external-service test isolation, and deliberately testing failure scenarios.3 core1 standard4 concepts

