Subcategories
Packages
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.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
A pytest plugin that measures code coverage during test runs, automatically combining coverage data and supporting distributed testing with pytest-xdist.
Install it if you want coverage reports as part of your normal test workflow.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Provides a pytest fixture that wraps the mock library's patching API, automatically cleaning up patches after each test and offering utilities like spy and stub for easier mocking in pytest test suites.
Aborts pytest tests that exceed a specified time limit, with stack dumps of hanging threads to help diagnose deadlocks and timeouts.
Install it if you run tests in environments where manual intervention is impractical; skip it if your test suite is already fast and you have other mechanisms to…
Automate Chromium, Firefox, and WebKit browsers via a single Python API for web testing, scraping, and interaction automation.
Faker generates realistic fake data—names, addresses, emails, phone numbers, and more—for testing, database bootstrapping, and data anonymization across multiple locales.
Install it if you need realistic fake data for tests, prototyping, or anonymization; skip it only if you have no use for generated test data.
A pytest plugin that automatically reruns failed tests to eliminate intermittent failures, with support for delays, exponential backoff, exception filtering, and hard crash recovery when used with pytest-xdist.
Install it if your test suite has intermittent failures you want to suppress without rewriting tests.
Pylint is a static code analyzer that checks Python code for errors, enforces coding standards, detects code smells, and suggests refactoring improvements without executing the code.
Install it if you need thorough code analysis with inference-based bug detection; if speed is critical, consider pairing it with faster linters like ruff for…
Provides cross-platform path objects, INI file parsing, code introspection, and utility modules for Python development—now largely superseded by modern alternatives.
No, not for new code.
FreezeGun mocks Python's datetime and time modules to let tests run at a fixed or controlled point in time, supporting decorators, context managers, and manual time manipulation.
Selenium provides Python bindings to automate web browser interaction, allowing you to programmatically control Chrome, Edge, Firefox, Safari, and other browsers for testing and automation tasks.
Install it if you need to automate browser interactions, test JavaScript-heavy web applications, or scrape dynamic content.
Astroid builds an extended abstract syntax tree (AST) representation of Python source code with static inference and name-scope analysis, powering tools like pylint.
Install it if you're building or extending code-quality tooling.
Browser Use is a Python library that lets AI agents automate web browser tasks—opening pages, clicking buttons, filling forms, and extracting data—by describing what you want done in natural language.
Hypothesis is a property-based testing library that generates random test inputs within specified ranges to find edge cases and bugs, then simplifies failing cases to their minimal form for easier debugging.
Install it if you want to catch bugs your manual tests miss.
Moto mocks AWS services for testing, allowing you to test code that calls boto3 without hitting real AWS infrastructure.
Install it if you write code that calls boto3.
yamllint checks YAML files for syntax errors, style violations, and structural problems like key repetition, line length, trailing spaces, and indentation issues.
A fast Python type checker and language server written in Rust, providing type analysis, diagnostics, and IDE integration for Python codebases.
tox automates testing across multiple Python environments and versions, managing virtual environments and running test suites with configurable test tools to verify package builds and compatibility.
Install it if you maintain a Python package or work on projects that require multi-environment testing.
A pytest plugin that captures and exposes test session metadata—Python version, platform, installed packages, plugins, and CI environment variables—for use in tests, fixtures, reports, and custom hooks.
mock provides a backport of Python's standard library unittest.mock for Python 3.6 and later, allowing you to replace parts of your system under test with mock objects and assert how they were used.
uv-build is a build backend that integrates uv's fast dependency resolution into Python project builds.
Intercepts and mocks HTTP requests made through the requests library, allowing you to stub out responses in tests without hitting real servers.
Install it if you write tests for code that makes HTTP calls.
Defines and validates data quality expectations—unit tests for data—and generates documentation of validation results to help teams maintain consistent data standards.
VCR.py records HTTP interactions during test runs and replays them on subsequent runs, eliminating live HTTP requests and making tests deterministic and fast.
Install it if your test suite makes HTTP requests and you want faster, more reliable, offline-capable tests.
Enables running pytest tests through setup.py by integrating pytest with setuptools' test command, though this approach is now deprecated in favor of modern test runners.
Compares test coverage reports against git diffs to identify which new or modified lines lack test coverage, and optionally reports code quality violations in those same lines.
Mocks and freezes time in tests, allowing you to travel to any point in the past or future and control how time advances during test execution.
Install it if you write tests for time-dependent code.
factory_boy replaces static test fixtures with declarative factories that generate customized test objects on demand, supporting multiple build strategies and ORM integration.
Install it if you write tests for ORM-backed applications or complex object hierarchies.
RESPX mocks HTTPX and HTTP Core libraries for testing, letting you define request patterns and inject responses without hitting real endpoints.
Generates HTML reports for pytest test results, turning test execution data into viewable web pages with test summaries, pass/fail status, and metadata.
Install it if you need HTML test reports; it's a standard tool in pytest ecosystems.
pytest-django integrates Django with pytest, letting you write and run Django tests using pytest's fixtures, plugins, and conventions instead of Django's built-in test runner.
Parameterized testing decorator that works with nose, pytest, unittest, and other Python test frameworks to run the same test function across multiple input sets.
However, maintenance is dormant with the last release on 2023-03-27, so compatibility with future Python versions is uncertain.
Provides a programmatic API to read and interact with Python projects defined by pyproject.toml files, handling project metadata and configuration parsing.