Testing Strategies
Prerequisites: Testing
Beyond individual pytest functions, real projects organize tests into
layers:
- Unit tests — test one function/class in isolation, fast, the bulk of a test suite.
- Integration tests — test several pieces together (e.g. a service plus a real test database).
- End-to-end tests — test the whole system the way a user would use it, fewest in number since they're the slowest to run.
A healthy test suite has many unit tests, some integration tests, and few end-to-end tests — not an even split, and not only one kind.