partest 1.4.0
Methodology-driven API + UI autotest harness for Python, plus partest-gen
scaffold for aqa-style monorepo suites.
Start here: QUICKSTART.md · MIGRATION.md
Cookbooks: REPORTING · SECURITY · UI · RECIPES · ENTERPRISE
Install
pip install partest
pip install partest[ui] # Playwright + Pillow
# development:
pip install -e ".[ui]"
Quick start — write tests
from partest import ApiClient, TypesTestCases, TrackingApiClient, CreatedRegistry
import partest.reporting as ah
from partest.zorro_report import zorro
types = TypesTestCases
await api_client.make_request(
"GET",
"/items/{id}",
add_url1="/1",
defining_url="/items/{id}",
expected_status_code=200,
validate_model=MyValidator,
type=types.request_default,
)
Coverage report:
report = zorro() # Allure + coverage_report.html
Harness modules
from partest import TrackingApiClient, CreatedRegistry, TokenManager, BaseRequestBody, Config
from partest.security import SecHttp, build_tampered_set
from partest.validation import BaseResponseValidator, ProblemDetailValidation
import partest.reporting as ah
from partest.env import load_project_env, require_env
from partest.data_marker import marked_name
from partest.ui import BasePage, attach_monitor, compare_images # partest[ui]
| Module | Role |
|---|---|
| TrackingApiClient | POST track + cleanup |
| TokenManager | OIDC multi-role cache |
| SecHttp | raw httpx security transport |
| build_tampered_set | JWT tampering fixtures |
| Config | headers/params builders |
| reporting | ah.check_*, instrumented requests |
| ui | BasePage, PageMonitor, visual, capture_baselines (extra) |
pytest plugin auto-loads (partest.pytest_plugin): Allure titles from docstring.
Disable dual hooks: PARTEST_PYTEST_PLUGIN=0, pytest_plugin = False in confpartest,
or pytest -p no:partest.
Raw body: content= + content_type= on ApiClient for IncorrectBody.
Multi-status: expected_status_code=(400, 415).
RiskProfile (consumer keeps entity registry)::
from partest import RiskProfile
RiskProfile("clients", writes=True, fk_traversal=True) # level=high
UI baselines:
python -m partest.ui.capture_baselines --out src/ui/baselines/reference \
--scenes scenes.json --dry-run
Coverage: matrix vs flat (confpartest)
| Mode | When | Config |
|---|---|---|
| Matrix (default) | methodology subtype × P1 | ignore flat list; use_matrix=True |
| Flat (legacy) | old projects | test_types_coverage = [...] + use_matrix=False |
See MIGRATION.md § coverage.
Test types
Canonical: request_default, request_permissions, request_new_object,
request_incorrect_body, request_elements, request_not_found,
request_not_allowed, …
Legacy aliases still work: default, 405, elem, …
type= is recommended; auto-inference is high-confidence only for 405/404/broken JSON.
Scaffold — partest-gen
partest-gen from-openapi ./my-suite --file openapi.yaml --depth p1 --force
partest-gen init-ui ./my-suite --force
partest-gen sync-openapi ./my-suite --depth p1
partest-gen dump-ir openapi.yaml -o .partest/suite_ir.json
--depth |
Generates |
|---|---|
resources |
paths + collections (G2) |
default |
+ payloads/validations + Default/405 tests (G3) |
p1 |
+ full P1 matrix stubs + checklist (G4) |
| UI | Command |
|---|---|
| With new project | partest-gen init … --with-ui |
| Add to existing | partest-gen init-ui ./my-suite |
UI suite is isolated: no OpenAPI/partest coverage session under src/ui/.
Configuration
confpartest.py
swagger_files = {
"myservice": ["local", "docs/openapi.yaml"],
}
test_types_coverage = ["request_default", "request_not_allowed"] # legacy flat mode
test_types_exception = ["health"]
Fixtures: domain / api_client / reset_storage — see generated conftest.py.
Maintainers
- Continue development: DEVELOPMENT.md
- Status board: IMPLEMENTATION_PLAN.md
- Agent rules: repo root
AGENTS.md - Skill:
.grok/skills/partest/
Version
1.3.0 — core + harness 1.1 + security/http/plugin (1.2) + partest[ui] (1.3) + generator G1–G5.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file partest-1.4.0.tar.gz.
File metadata
- Download URL: partest-1.4.0.tar.gz
- Upload date:
- Size: 164.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb06568546dba7e7b69f68cbf57f3a8df5df811c17f4ef4549fd9a1334083bc3
|
|
| MD5 |
8268bbd3998fc4add9a3ab008f771da8
|
|
| BLAKE2b-256 |
764444579992775c7e2ae0b674ad0e6fb649a1ba9d1deb9f49e8ff15e7f9b13c
|
File details
Details for the file partest-1.4.0-py3-none-any.whl.
File metadata
- Download URL: partest-1.4.0-py3-none-any.whl
- Upload date:
- Size: 185.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7fe99c88a6ecf235e55bad4cf1338a9bb9f564cd0562f3de71d04c71d12b1e
|
|
| MD5 |
ffbaea7cabb18e07cdebcef608e637b8
|
|
| BLAKE2b-256 |
417259c44df70b3a2eb1d07ec0808763ee71962e11dac18d654d75d17ced1e1d
|