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

Release files for pytest-ditto 2.0.0b1

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

Built distribution (wheel)

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

Total release size: 113.6 kB

Release files / pytest_ditto-2.0.0b1.tar.gz

Download URL pytest_ditto-2.0.0b1.tar.gz
Size 51.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0f5a5ff0d7c1d80553b2e874c05b9a7e0a10dd9c725b7c83586ec945ac5c2f1d
BLAKE2b-256 checksum
How to use checksums
b7958cd8720171a70a218f45450525193d781e06f3aa293a393cd22531675f59
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 27, 2026.

Transparency log

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

Download URL pytest_ditto-2.0.0b1-py3-none-any.whl
Size 62.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10635448cf80b69d915f4fb1b76929bf056de90d4757c7e227e9b92b73f05af5
BLAKE2b-256 checksum
How to use checksums
a47b5c85c06d4eb0c8ff5dfbb10d09787e714a90f9f61d0da3d8c9bf05c646b7
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 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0b1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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