Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pytest-ditto

PyPI version Continuous Integration Documentation

Snapshot testing pytest plugin with minimal ceremony and flexible recorders.

📖 Documentation

Features

  • Snapshot fixture — record test outputs once, assert they don't change
  • Flexible recorders — strict JSON by default, built-in YAML, and external recorders for specialised data
  • Remote backends — store snapshots locally, on S3, in PostgreSQL, Redis, DuckDB, or anywhere via fsspec
  • Named profiles — reusable, named backend targets with isolated credentials
  • CLI tools — list, update, prune, lint, and manage snapshots from the command line

Quick Start

pip install pytest-ditto
import ditto


def fn(x: int) -> int:
    return x + 1


def test_fn(snapshot) -> None:
    result = fn(1)
    assert result == snapshot(result, key="fn")

First run records the result. Subsequent runs assert it hasn't changed.

Recorders

Mark Format Extension
no mark / @ditto.json strict JSON (default) .json
@ditto.yaml YAML .yaml
@ditto.pandas.parquet pandas DataFrame .pandas.parquet
@ditto.polars.parquet polars DataFrame .polars.parquet
@ditto.pyarrow.parquet PyArrow Table .pyarrow.parquet

Strict JSON accepts only exact built-in None, bool, int, finite float, str, list, and string-keyed dict values, recursively. Install external recorders explicitly for other data models. See the recorder and upgrading guides before migrating snapshots from pytest-ditto 1.x.

Documentation

Full documentation is available at owlowlyowl.github.io/pytest-ditto, including:

Examples

See examples/ for self-contained local, PostgreSQL, Redis, and DuckDB examples.

Metadata

Release files for pytest-ditto 2.0.0rc2

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

Source distribution (sdist)

Source distribution for pytest-ditto 2.0.0rc2
File Size Uploaded
pytest_ditto-2.0.0rc2.tar.gz 72.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-ditto 2.0.0rc2
File Interpreter ABI Platform
pytest_ditto-2.0.0rc2-py3-none-any.whl Python 3 none any Details

Total release size: 162.4 kB

Release files / pytest_ditto-2.0.0rc2.tar.gz

Download URL pytest_ditto-2.0.0rc2.tar.gz
Size 72.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0e3d2f63e9184f00f9d347e6b986b8e29e6353cd32e48bcc58d34299f8d2fe6e
BLAKE2b-256 checksum
How to use checksums
5889d332fb61a7bead6ba68d17471470c9ed77331039effdc4021711cd07300d
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 Oct 7, 2026.

Transparency log

Release files / pytest_ditto-2.0.0rc2-py3-none-any.whl

Download URL pytest_ditto-2.0.0rc2-py3-none-any.whl
Size 90.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff3cd93669bfccf5aba01e96788d6830e4b99222e4354a9b459ae96c3269ddf6
BLAKE2b-256 checksum
How to use checksums
8d6dc0277725f99c10efecae746614d175ae47909941d9e9f3a70a14ef3cd9b0
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 Oct 7, 2026.

Transparency log
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