Skip to content
testcritic

pytest

The de facto Python testing framework: fixtures, parametrisation, plugins.

Unit & ComponentOpen sourceSelf-hostable
Visit pytest

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

Essentially every Python project.

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 source

Free 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 site

Figures are indicative and were last reviewed August 2026. Vendors change pricing often; confirm before you commit.

Works with

toxGitHub ActionsJenkinsAllureSonarQubePlaywright

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.

Explore all alternatives