pytest
The de facto Python testing framework: fixtures, parametrisation, plugins.
What it is
pytest replaces class-based unittest boilerplate with plain functions and plain assert statements, then adds a fixture system that makes dependency setup composable and a parametrisation decorator that turns one test into fifty. Its plugin ecosystem covers coverage, async, Django, benchmarking, distributed execution and much more.
Best for
Where it is strong
- Fixtures are the best dependency-injection model in any test framework, and they compose cleanly.
- Assertion introspection produces genuinely useful failure output from a plain assert.
- Vast plugin ecosystem — pytest-xdist, pytest-cov, pytest-asyncio, pytest-django.
Where it falls short
- Fixture scope and ordering become genuinely hard to reason about in large suites.
- The magic that makes simple cases elegant makes complex cases opaque.
- Python only.
Pricing
Free and open source
Open sourceFree tier: Everything, self-hosted
What drives the bill: Free and open source. You pay in engineering time and CI minutes.
Check current pricing on pytest-dev’s siteFigures are indicative and were last reviewed August 2026. Vendors change pricing often; confirm before you commit.
Works with
What people who use pytest say
No reviews of pytest yet. If you have used it in anger, yours would be the first.
Alternatives to pytest
If pytest is not the right fit, these solve the same problem differently.
