Skip to main content

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, raw content=, 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.
  • A scaffold, if you want one — partest-gen is a separate package that writes a runnable 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 TokenManager with injected credentials, created-resource tracking with LIFO cleanup, SecHttp raw 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

The generator ships separately, as partest-gen — it runs once when a project is created rather than on every test run, so it is not part of this install:

pip install partest-gen        # brings partest with it
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.

Upgrading from a version where the generator lived inside this package? partest.project_gen still resolves once partest-gen is installed, and pip install 'partest[gen]' installs both. The partest-gen command itself now comes from that package, not this one.

Documentation

Source, issues and the full documentation wiki: https://github.com/Dec01/partest

The user-facing pages also ship inside the package, so they are readable next to your installed copy without a trip to the browser:

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, permissions, upload testing, reporting, security, UI, recipes, layers, and enterprise notes (shared client, retries, redaction, xdist). The decisions behind them — why coverage is scored this way, what stays in your project — live in the repository, not the wheel.

Or from Python:

from partest.docs import list_docs, read_doc
print(read_doc("concepts-methodology.md"))

Requirements

Python 3.10+. 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.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for partest 1.8.1
File Size Uploaded
partest-1.8.1.tar.gz 176.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for partest 1.8.1
File Interpreter ABI Platform
partest-1.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 376.9 kB

Release files / partest-1.8.1.tar.gz

Download URL partest-1.8.1.tar.gz
Size 176.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bd3e68fdaf82ea0d6d0c44209d6ba8f99fd8e3b1f191b1faaf726bb8d4102324
BLAKE2b-256 checksum
How to use checksums
dcc80f59326ad40b497bae6275bb6c7161e9b049a74fb5f300f4009b0b97e29d
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.8.1-py3-none-any.whl

Download URL partest-1.8.1-py3-none-any.whl
Size 200.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa08b93c9bd70505e7e14b7219ef67e53f8e2c6bed6cad77259fae4b263495f4
BLAKE2b-256 checksum
How to use checksums
bce93e7c3076dd48f47148826c332694b137b0f0f0bee6dcd7a182aaf61f6f9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release history Release notifications | RSS feed

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

This release

1.8.1 This release

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.0

2 release files

0.3.0

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.76

2 release files

0.1.75

2 release files

0.1.74

2 release files

0.1.73

2 release files

0.1.72

2 release files

0.1.71

2 release files

0.1.70

2 release files

0.1.69

2 release files

0.1.68

2 release files

0.1.67

2 release files

0.1.66

2 release files

0.1.65

2 release files

0.1.64

2 release files

0.1.63

2 release files

0.1.62

2 release files

0.1.61

2 release files

0.1.60

2 release files

0.1.59

2 release files

0.1.58

2 release files

0.1.57

2 release files

0.1.56

2 release files

0.1.55

2 release files

0.1.54

2 release files

0.1.53

2 release files

0.1.52

2 release files

0.1.51

2 release files

0.1.50

2 release files

0.1.49

2 release files

0.1.48

2 release files

0.1.47

2 release files

0.1.46

2 release files

0.1.45

2 release files

0.1.44

2 release files

0.1.43

2 release files

0.1.42

2 release files

0.1.41

2 release files

0.1.40

2 release files

0.1.39

2 release files

0.1.38

2 release files

0.1.37

2 release files

0.1.36

2 release files

0.1.35

2 release files

0.1.34

2 release files

0.1.33

2 release files

0.1.32

2 release files

0.1.9

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page