partest
Methodology-driven API (and optional UI) autotest harness for Python, with OpenAPI coverage that measures whether the right test cases exist — not just whether an endpoint was called.
pip install partest
pip install 'partest[ui]' # + Playwright and Pillow for UI suites
What you get
ApiClient— async HTTP for suites: JSON, form, files, rawcontent=, multi-status expectations, GraphQL, and rich status-mismatch errors.- Coverage by methodology — every operation is classified into a method subtype, and each subtype has a required set of test cases. The report tells you which cases are missing.
partest-gen— scaffold a runnable pytest monorepo suite straight from an OpenAPI file.- Reporting —
check_*helpers, Allure steps and attaches (Allure is a soft dependency), interactive HTML coverage,coverage.json, compare / badge / stub CLI. - Auth, tracking, security — OIDC
TokenManagerwith injected credentials, created-resource tracking with LIFO cleanup,SecHttpraw transport, JWT tampering sets,RiskProfile. - UI extra —
BasePage,PageMonitor, storage helpers, visual comparison, baseline capture.
A first test
from partest import ApiClient, TypesTestCases
from partest.zorro_report import zorro
types = TypesTestCases
async def test_get_item(api_client):
"""Item is returned by id."""
await api_client.make_request(
"GET",
"/items/{id}",
add_url1="/1",
defining_url="/items/{id}", # OpenAPI template — this is what coverage matches
expected_status_code=200,
validate_model=ItemValidation,
type=types.request_default, # explicit type beats inference
)
def test_zorro():
report = zorro() # Allure summary + coverage HTML
# report.endpoints[*].missing_p1 → your backlog for the next test cases
Scaffold a whole suite
partest-gen from-openapi ./my-suite --file openapi.yaml --depth p1 --with-ui
partest-gen sync-openapi ./my-suite --depth p1 # after the spec changes
--depth resources emits paths and collections, default adds payloads, validators and the
first tests, p1 adds the full priority-one stub matrix plus a checklist per tag.
Documentation
Full documentation ships inside the package — there is no separate docs site:
python -m partest.docs list # what is available
python -m partest.docs show howto-quickstart # read a page
python -m partest.docs path # where the files live
Included: quickstart, migration notes, the coverage methodology, reporting, security, UI, recipes, enterprise notes (shared client, retries, redaction, xdist) and the package map.
Or from Python:
from partest.docs import list_docs, read_doc
print(read_doc("concepts-methodology.md"))
Requirements
Python 3.9+. Core dependencies: httpx, pydantic, pyyaml, pytest, pytest-asyncio,
allure-pytest, requests, python-dotenv, Faker, matplotlib. The ui extra adds
playwright and Pillow.
The bundled pytest plugin loads automatically and enriches Allure titles. Turn it off with
PARTEST_PYTEST_PLUGIN=0, pytest_plugin = False in confpartest.py, or pytest -p no:partest
if your project already owns Allure hooks.
License
MIT.
Release files for partest 1.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| partest-1.7.0.tar.gz | 213.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| partest-1.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 467.2 kB
Release files / partest-1.7.0.tar.gz
| Download URL | partest-1.7.0.tar.gz |
|---|---|
| Size | 213.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ed7f099d35c2b8cdc635aab251592ee1fe676668718b206ca6d578a13d5726b
|
|
BLAKE2b-256 checksum How to use checksums |
89ec9f14eb46d2e0dd7c6650042a825e4cecad0732421e5ea8372f38c560be24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / partest-1.7.0-py3-none-any.whl
| Download URL | partest-1.7.0-py3-none-any.whl |
|---|---|
| Size | 253.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54c925afbb1a5df5d0f604f8f3f32ccab55e67058fa45bc5b6176d3ed7a5ab01
|
|
BLAKE2b-256 checksum How to use checksums |
215c37a2f0956d4197631e234f1f4f01b4c66ef5808ec091104d2c5168eebc3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|