Tools · SPBoucher
Menu

pytest

by pytest-dev team · Framework · also known as py.test

Python testing framework with plain assert statements, fixtures, parametrization and a large plugin ecosystem, the de facto standard for Python test suites

MIT licenseOpen sourceFreeLocalCloudSelf-hostable
Visit official site Compare

Link verified Nov 2, 2026

Overview

pytest is a testing framework for Python maintained by the pytest-dev team under the MIT license. Tests are ordinary functions that use the built-in assert statement; pytest rewrites assertions to produce detailed failure messages without a special assertion API. Fixtures provide dependency injection for setup and teardown with configurable scope, and parametrization generates test cases from data tables.

The plugin architecture is its ecosystem: pytest-cov adds coverage, pytest-xdist distributes tests across CPU cores or machines, pytest-asyncio supports coroutines, Hypothesis integrates property-based testing, and Playwright ships an official pytest plugin for browser tests. pytest also runs unittest and nose-style suites, so adoption in legacy codebases is incremental. It is the default runner in most scientific Python projects and in tooling such as uv-managed packages. Limitations are mostly conceptual: fixture resolution through function arguments can be opaque in large suites, and plugin interactions sometimes complicate configuration in pyproject.toml or pytest.ini.

Capabilities

  • Plain assert statements with detailed introspection
  • Fixtures with scopes and dependency injection
  • Parametrized tests
  • Plugin system (coverage, parallel execution, async, browsers)
  • Compatibility with unittest suites
  • Marker-based selection and configurable collection

Typical workflows

  1. Run a package's test suite in CI with coverage
  2. Parallelize slow tests across cores with pytest-xdist
  3. Drive browser tests through the Playwright plugin

Strengths

  • Minimal boilerplate
  • Very large plugin ecosystem
  • MIT license

Limitations

  • Fixture magic can be hard to trace in large suites
  • Plugin interactions complicate configuration

Prerequisites

  • Python; install with uv or pip

Who it is for

  • Python developers
  • Data scientists testing pipelines
  • Package maintainers

Alternatives & comparison

The standard library's unittest module is the built-in alternative with a class-based, xUnit-style API; pytest runs those tests as well and is generally preferred for new code because of fixtures and assertion rewriting.

Sources & verification

Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.

Confidence
High
Reviewed
Nov 1, 2026
Links
Verified · Nov 2, 2026

Spotted an error?

Broken link, outdated license, wrong category, or a tool that no longer exists? Tell us; reports are reviewed by the editor.

Playwright

Microsoft · Testing & QA

In-depth entry

Microsoft's browser automation and end-to-end testing framework driving Chromium, Firefox and WebKit from one API in TypeScript, Python, Java and .NET

Apache-2.0Open sourceFreeLocalSelf-hostedNov 2, 2026

Puppeteer

Google (Chrome DevTools team) · Data collection & crawling

In-depth entry

Node.js library from the Chrome team for controlling Chrome and Firefox over the DevTools Protocol or WebDriver BiDi, used for scraping, screenshots, PDFs and testing

Apache-2.0Open sourceFreeLocalSelf-hostedNov 2, 2026

ESLint

OpenJS Foundation · Testing & QA

Pluggable static analysis tool for JavaScript and TypeScript that finds problems in code through configurable rules and can fix many automatically

MITOpen sourceFreeLocalNov 2, 2026

Cypress

Cypress.io · Testing & QA

End-to-end and component testing framework that runs tests inside the browser with an interactive runner, paired with the commercial Cypress Cloud

MITOpen sourceFreeLocalNov 2, 2026

Vitest

VoidZero / Vitest team · Testing & QA

Vite-native unit test framework for JavaScript and TypeScript with a Jest-compatible API, watch mode, coverage and browser mode

MITOpen sourceFreeLocalNov 2, 2026

Biome

Biome project · Testing & QA

Rust-based formatter and linter for JavaScript, TypeScript, JSX, JSON, CSS and GraphQL that replaces Prettier and ESLint with one binary

MIT OR Apache-2.0Open sourceFreeLocalNov 2, 2026