Skip to main content

testivai (Python)

Local-first visual regression for playwright-python — pixel + DOM comparison with tunable tolerances, a self-contained HTML report, and PR-comment baseline approvals. Shares the exact on-disk contract with the JS/TS TestivAI adapters, so mixed-language repos use one set of baselines, one report, one approval flow.

pip install testivai[playwright]

With pytest (pytest-playwright)

def test_homepage(page, testivai_witness):
    page.goto("http://localhost:3000")
    testivai_witness(page, "homepage")

The bundled pytest plugin runs testivai report at session end: captures are diffed against .testivai/baselines/, tolerances from .testivai/config.json apply, and visual-report/index.html + results.json are written. Approve baselines with npx testivai approve --all (or a /testivai approve PR comment via the GitHub Action).

Without pytest

from testivai import witness, run_report

witness(page, "homepage", ignore_selectors=[".live-feed"], variant="firefox")
run_report()

What captures do (identical to the JS adapters)

  • Stabilization by default: animations/transitions complete instantly at their final state, caret hidden, web fonts awaited — the top causes of flaky visual diffs, neutralized.
  • ignore_selectors: hidden from the pixels and excluded from the DOM snapshot (dynamic content never counts as a change).
  • variant: folds into the snapshot name (homepage__firefox) so parallel browsers/viewports never overwrite each other's baselines.

The compare/report half runs via the @testivai/witness CLI — Node.js is already present wherever playwright-python is (Playwright for Python ships a Node driver). Resolution order: TESTIVAI_CLI env → testivai on PATH → npx --yes @testivai/witness.

Docs: https://github.com/testivai/testivai-oss/blob/main/docs/frameworks/python.md

MIT.

Metadata

Release files for testivai 0.2.0

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

Source distribution (sdist)

Source distribution for testivai 0.2.0
File Size Uploaded Provenance Actions
testivai-0.2.0.tar.gz 17.5 kB With provenance Details for testivai-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 35.0 kB

Release files / testivai-0.2.0.tar.gz

Download URL testivai-0.2.0.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
60396ddb8823fbe7519b984bb15627f8e838fbe3ca313c75c8f4974b5e5a0603
BLAKE2b-256 checksum
How to use checksums
024abfb2fe23f0f0936b6047bdfb9f9874e7bfb293bb2fd8d3a7f1fc763ce70b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / testivai-0.2.0-py3-none-any.whl

Download URL testivai-0.2.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f4d9bfb46bcb0475ab3b943dcfde7dfdc4859f89290320923a72b75870fecb1
BLAKE2b-256 checksum
How to use checksums
cf2c07fbea1af374bc08fb9e0105a2f5521058c48f6d326aa2b9c3fa8e85b456
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Security for testivai 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for testivai-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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