pytest

The standard Python testing framework: plain assert statements, powerful fixtures and a rich plugin ecosystem.

pytest discovers tests automatically, rewrites plain assert statements to give detailed failure output, and uses fixtures for composable setup and teardown. Parametrisation and a large plugin ecosystem (coverage, xdist for parallel runs, asyncio, Django) make it suitable from small scripts to large codebases.

Type
Testing
Category
Testing
Maintainer
pytest-dev
First released
2004
License
Open source (MIT)
Pricing
Open source
Level
Beginner
Technologies
python, testing
GitHub stars
14,891
Weekly downloads
246,089,841 (pypi)
Latest release
[object Object]
Last verified
26 Nov 2026

What pytest is used for

  • Unit and integration tests in Python
  • API tests
  • Data pipeline checks

Strengths

  • Minimal boilerplate
  • Powerful fixtures and parametrisation
  • Huge plugin ecosystem

Limitations

  • Fixture magic can confuse newcomers
  • Large suites need parallelisation plugins

pytest alternatives

How it relates to other tools

Built with the same technologies

Learn pytest

Official links

Sources

Explore