pytest
pytest: simple powerful testing with Python
Decision gist · record as of 2026-08-14
Yes. pytest is the de facto standard Python testing framework, actively maintained, permissively licensed, and has no security vulnerabilities. It installs with low friction and is suitable for projects of any size, from simple unit tests to complex functional testing. Its widespread adoption means excellent documentation and a large ecosystem of plugins.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Actively maintained with a release 56 days ago.
- Low install friction with 7 runtime dependencies, all lightweight.
License · maintenance · safety
MIT (permissive) — Distributed under the MIT license, which is permissive and imposes no restrictions on commercial or proprietary use.
last release 2026-06-19 (56 days) · last repo commit 2026-08-12 · 14,413 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,091,772,181 downloads/mo, #22 on PyPI
Alternatives
Verify before relying
pip install pytest
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 4
# Run: pytest- Whether the 1300+ external plugins mentioned in the description are actively maintained and compatible with current pytest versions.
- Performance characteristics when running very large test suites (thousands of tests).
What it is and what it does
pytest is a mature testing framework that simplifies writing and running Python tests. Instead of inheriting from test classes or using verbose assertion methods, you write plain functions with simple assert statements. pytest automatically discovers test files and functions following naming conventions, runs them, and provides detailed output showing exactly where assertions failed and why.
The framework is built on a plugin architecture, allowing you to extend it with custom fixtures (reusable test resources), parametrization (running the same test with different inputs), and markers for organizing and filtering tests. It runs unittest test suites out of the box and integrates with many third-party tools. With 7 lightweight runtime dependencies and no compiled requirements, it installs quickly and works across Windows, macOS, and Unix systems.
Use it for
- Write and run unit tests for Python functions and classes using simple assert statements.
- Parametrize tests to run the same test logic against multiple input values automatically.
- Use fixtures to set up and tear down test resources like database connections or temporary files.
- Integrate pytest into CI/CD pipelines to run test suites on every commit.
- Migrate existing unittest test suites to pytest without rewriting them.
- Debug test failures with detailed assertion introspection showing intermediate values.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pytest is the de facto standard Python testing framework, actively maintained, permissively licensed, and has no security vulnerabilities. It installs with low friction and is suitable for projects of any size, from simple unit tests to complex functional testing. Its widespread adoption means excellent documentation and a large ecosystem of plugins.
Install
pytest on PyPI
Before you install
Actively maintained with a release 56 days ago. Low install friction with 7 runtime dependencies, all lightweight. The project has 14413 stars and is in the top 100 most-downloaded packages on PyPI.
Requires Python 3.10 or later.
License in practice
Distributed under the MIT license, which is permissive and imposes no restrictions on commercial or proprietary use.
Quickstart
pip install pytest
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 4
# Run: pytest
Verify before relying
- Whether the 1300+ external plugins mentioned in the description are actively maintained and compatible with current pytest versions.
- Performance characteristics when running very large test suites (thousands of tests).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagescoloramaexceptiongroupiniconfigpackagingpluggypygmentstomli |
| Maintenance | Actively maintained 56 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,091,772,181 / month, #22 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: Software Development :: LibrariesTopic :: Software Development :: TestingTopic :: Utilities |
Evidence: pytest-9.1.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “assert-based testing”
- pytestpytest is a testing framework that lets you write test functions…
- grpcio-testingProvides testing utilities and fixtures for building and testing gRPC…
- pytest-snapshotA pytest plugin that enables snapshot testing—comparing test outputs…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
iniconfig parses INI configuration files while preserving section and entry order, supporting multi-line values, comments, and raising errors with line numbers.
See also pytest-django · pytest-xprocess · pytest-raises · pytest-subtests · rtest · testinfra · pytest-selenium · pytest-variables · pytest-testinfra · pytest-azurepipelines