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.0rc1

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.0rc1
File Size Uploaded
pytest_ditto-2.0.0rc1.tar.gz 63.9 kB Details

Built distribution (wheel)

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

Total release size: 142.1 kB

Release files / pytest_ditto-2.0.0rc1.tar.gz

Download URL pytest_ditto-2.0.0rc1.tar.gz
Size 63.9 kB
Tags Source
SHA-256 checksum
How to use checksums
46bd26f8b84708ea78bf7b7e4983cf6768a82b213dda290c843b10496fd8b907
BLAKE2b-256 checksum
How to use checksums
71e79f8f13b26d6fad744ddd6472518023ac7d55139817a12b73ec4899d0de97
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 Sep 30, 2026.

Transparency log

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

Download URL pytest_ditto-2.0.0rc1-py3-none-any.whl
Size 78.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa7514a7f7a112b8c7e3605ff2150a2ca30764cc30f483f9bcda5c7cbf672507
BLAKE2b-256 checksum
How to use checksums
9df33b7b6c93179d64bc28518555086dc3cbe4932c382fcb08bf803486d850ee
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 Sep 30, 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