Listed in editorial order, grouped by use case. Click a column to re-sort the whole list.
Press / to search. Tap a tag to filter. Click any row for details.
Search and filter
Results
| Row number | Tags | |||||
|---|---|---|---|---|---|---|
Frameworks 3 projects |
||||||
| 1 | pytest Frameworks | 780,138,529 | 14,557 | Frameworks Testing Developer Tools | → | |
|
A mature full-featured Python testing tool.
|
||||||
| 2 | hypothesis Frameworks | 52,853,067 | 9,035 | Frameworks Testing Developer Tools | → | |
|
Hypothesis is an advanced Quickcheck style property based testing library.
|
||||||
| 3 | robotframework Frameworks | 4,073,950 | 11,922 | Frameworks Testing Developer Tools | → | |
|
A generic test automation framework.
|
||||||
Test Runners 2 projects |
||||||
| 4 | tox Test Runners | 14,532,693 | 3,942 | Test Runners Testing Developer Tools | → | |
|
Auto builds and tests distributions in multiple Python versions.
|
||||||
| 5 | nox Test Runners | 3,848,837 | 1,562 | Test Runners Testing Developer Tools | → | |
|
Flexible test automation for Python.
|
||||||
Browser Automation 3 projects |
||||||
| 6 | playwright-python Browser Automation | 95,806,221 | 15,024 | Browser Automation Testing Developer Tools | → | |
|
Python version of the Playwright testing and automation library.
|
||||||
| 7 | selenium Browser Automation | 28,624,046 | 34,518 | Browser Automation Testing Developer Tools | → | |
| 8 | seleniumbase Browser Automation | 1,342,323 | 13,049 | Browser Automation Testing Developer Tools | → | |
|
Python framework for web automation & testing, with stealth options.
|
||||||
Load Testing 1 project |
||||||
| 9 | locust Load Testing | 9,831,728 | 28,195 | Load Testing Testing Developer Tools | → | |
|
Scalable user load testing tool written in Python.
|
||||||
API Testing 1 project |
||||||
| 10 | schemathesis API Testing | 3,161,969 | 3,643 | API Testing Testing Developer Tools | → | |
|
A tool for automatic property-based testing of web APIs from OpenAPI or GraphQL schemas.
|
||||||
Mock 5 projects |
||||||
| 11 | unittest.mock Mock | Stdlib | 77,383 | Mock Testing Developer Tools Stdlib | → | |
|
(Python standard library) A mocking and patching library.
|
||||||
| 12 | responses Mock | 53,392,813 | 4,343 | Mock Testing Developer Tools | → | |
|
A utility library for mocking out the requests Python library.
|
||||||
| 13 | vcrpy Mock | 22,723,782 | 3,019 | Mock Testing Developer Tools | → | |
|
Record and replay HTTP interactions on your tests.
|
||||||
| 14 | respx Mock | 23,663,246 | 837 | Mock Testing Developer Tools | → | |
|
Mock HTTPX with awesome request patterns and response side effects.
|
||||||
| 15 | time-machine Mock | 19,997,178 | 1,010 | Mock Testing Developer Tools | → | |
|
Travel through time in your tests by mocking the current time at the C level.
|
||||||
Object Factories 2 projects |
||||||
| 16 | factory-boy Object Factories | 20,868,231 | 3,811 | Object Factories Testing Developer Tools | → | |
|
A test fixtures replacement for Python.
|
||||||
| 17 | polyfactory Object Factories | 11,696,823 | 1,512 | Object Factories Testing Developer Tools | → | |
|
A mock data generation library based on type hints (continuation of
pydantic-factories). |
||||||
Code Coverage 1 project |
||||||
| 18 | coverage Code Coverage | 288,579,309 | 3,410 | Code Coverage Testing Developer Tools | → | |
|
Code coverage measurement.
|
||||||
Fake Data 2 projects |
||||||
| 19 | faker Fake Data | 66,679,846 | 19,423 | Fake Data Testing Developer Tools | → | |
|
A Python package that generates fake data.
|
||||||
| 20 | mimesis Fake Data | 2,063,316 | 4,841 | Fake Data Testing Developer Tools | → | |
|
A Python library for generating fake but realistic data in multiple languages and locales.
|
||||||
No projects match your search or filter.
Try a broader term, or .
Testing guide
Write pytest tests as plain functions with plain assert statements: pytest's assertion introspection reports the intermediate values when one fails, so there are no assert methods to remember. Share setup through fixtures, which a test requests by name, instead of xUnit-style setup and teardown. pytest also runs unittest-based suites, so you can move an old suite over a test at a time.
Hypothesis tests take a @given decorator with a strategy describing the inputs, and Hypothesis picks which inputs to try, edge cases included. They're still regular functions that pytest or unittest runs.
Playwright's docs call its pytest plugin the recommended way to write end-to-end tests, and every test gets a fresh browser context. Playwright waits for elements to be actionable before each action, and its assertions wait for the expected condition. Locate elements by role and other user-facing attributes, not CSS or XPath, which break as the DOM changes.
Robot Framework writes test cases in a tabular, keyword-driven syntax, builds higher-level keywords from existing ones, and reports results in HTML. Custom keyword libraries are plain Python. In behavior-driven style, a test case reads as a requirement stakeholders who don't code can follow.
tox and Nox both create a virtual environment per Python version or dependency set and run your tests in each. tox defines its environments in a config file. Nox is configured in a noxfile.py, where each session is a Python function, so any logic your test matrix needs is ordinary code.
Selenium drives browsers through WebDriver, a W3C standard, and Selenium Grid runs those tests on other machines and platforms. Its guidelines model each page as a page object that makes no assertions, and use explicit waits for the exact condition each step needs. SeleniumBase builds on Selenium and runs under pytest: its methods wait for an element before acting, and failing tests save screenshots.
A Locust test is a Python program: an HttpUser class whose tasks make requests, so complex user flows are just code.
Schemathesis reads your OpenAPI or GraphQL schema and generates property-based tests from it, with no per-endpoint tests to maintain. Its FAQ recommends the CLI for most users, with a pytest integration for existing suites.
With unittest.mock, patch a name where it's looked up, which isn't always where it's defined. Autospec your mocks, so a test fails when your code calls an API the real object lacks. For the clock, time-machine mocks time functions everywhere they're referenced, where a patch only reaches the import location it targets.
For HTTP, pick by client. responses mocks Requests calls in a test wrapped in @responses.activate, and RESPX mocks HTTPX, with a respx_mock fixture for pytest. VCR.py records real HTTP interactions to a cassette file on the first run and replays them after, across many client libraries.
factory_boy replaces static fixtures with factories, where a test declares only the fields it cares about. It has base classes for Django, SQLAlchemy, and MongoEngine models. Polyfactory instead reads the type hints on dataclasses, TypedDicts, Pydantic models, and msgspec Structs to generate the data.
Run your suite under Coverage.py with coverage run -m pytest, then coverage report prints the results. For most purposes, you need no pytest plugin.
Faker generates names, addresses, and other data per locale. Mimesis covers the same ground, fully typed, and its benchmarks show it faster than Faker.
Random test data makes a failing build hard to reproduce, so seed it: Faker, factory_boy, and Mimesis all take a seed. For more tools, see awesome-python-testing.
Contribute
Know a project that belongs here?
Tell us what it does and why it stands out.