partest 1.3.0
Methodology-driven API + UI autotest harness for Python, plus partest-gen
scaffold for aqa-style monorepo suites.
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: pytest -p no:partest.
Raw body: content= + content_type= on ApiClient for IncorrectBody.
UI baselines:
python -m partest.ui.capture_baselines --out src/ui/baselines/reference \
--scenes scenes.json --dry-run
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.3.0.tar.gz.
File metadata
- Download URL: partest-1.3.0.tar.gz
- Upload date:
- Size: 120.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a692eed78faba7ba3213f43f1ad97a18964da542aa2843cb03b78312e3c1018
|
|
| MD5 |
f7fd745ddc756b893e73f4ee3534572d
|
|
| BLAKE2b-256 |
2296f52640680c78729574c15e7251dd891cf057f57f9a0ed8f10b31d78d4f0f
|
File details
Details for the file partest-1.3.0-py3-none-any.whl.
File metadata
- Download URL: partest-1.3.0-py3-none-any.whl
- Upload date:
- Size: 140.0 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 |
99a8a1c7b0470c4e9b24084b2fb600e9685e11c70ac33c890753517d0ef97f85
|
|
| MD5 |
8c4ba47e26f677cbb21fe2dcc4ac5f1e
|
|
| BLAKE2b-256 |
bf207fce240d1524c129403a9ebdbb549dffb24648167880720f351be54f522a
|