Skip to content

v6.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Aug 20:48
· 2 commits to main since this release
Immutable release. Only release title and notes can be modified.

Syrupy 6.0.0

(2026-08-22)

Syrupy 6 focuses on better built-in serialization, clearer snapshot workflows, and large-suite performance. Please review the breaking changes before upgrading.

Most suites should not need significant snapshot updates on upgrade — the main exception is dataclass usage (see below). Syrupy v6 does not change the required Python version or other package dependencies. Support for Python 3.10 will instead be dropped in the next Syrupy major version (v7).

Full Changelog: v5.5.3...v6.0.0


Breaking Changes

Built-in dataclass serialization (removed DataclassPlugin)

stdlib dataclasses are now serialized natively by the Amber serializer. The separate DataclassPlugin has been removed.

  • If you used DataclassPlugin: remove imports and plugin wiring. Behavior should match what the plugin produced; no snapshot rewrite should be needed for the dataclass shape itself.
  • If you did not use the plugin: dataclass snapshots may change from a repr-style string to structured Amber form (field-by-field). Re-run with --snapshot-update where those assertions fail.

Example of what to remove:

# Before (v5)
from syrupy.extensions.amber.dataclasses_plugin import DataclassPlugin

class MySerializer(AmberDataSerializer):
    serializer_plugins = [DataclassPlugin, ...]
# After (v6) — dataclasses work with the default Amber extension
assert MyDataclass(...) == snapshot

Attrs and Pydantic models are unchanged and still need their serializer plugins. See the serializer plugins example.

(#1220, closes #1048)

JSON datetime.date snapshots

The JSON extension now serializes datetime.date as YYYY-MM-DD instead of a repr string. Existing JSON snapshots that contain dates will need an update.

(#1216, closes #1058)

path_value nested path replacement in default (literal) mode

path_value(..., regex=False) now correctly replaces values at nested paths such as user.token. Previously, the default-mode lookup missed escaped path keys, so nested values were left unchanged (and could leak into committed snapshots).

If you relied on the old non-replacement behavior for nested literal paths, or your snapshots still contain values that should have been redacted, expect diffs and re-run with --snapshot-update as needed.

(#1162) — thanks @chuenchen309


Features

  • Mark snapshot tests with syrupy_snapshot — tests that use the snapshot fixture (directly or indirectly) are marked automatically. Update only those tests with:

    pytest --snapshot-update -m syrupy_snapshot

    (#1196, closes #922)

  • In-memory snapshot diffssnapshot(diff=...) accepts an in-memory baseline object (not only a snapshot index/name), so you can diff against data already in the test without writing a separate base snapshot.

    (#1175, closes #608)

  • --snapshot-declaration-order (experimental) — write Amber snapshots in pytest collection/declaration order (including parametrize/ids order) instead of alphabetical snapshot name order.

    (#1222, closes #968)

  • --snapshot-disable-unused — escape hatch to skip unused-snapshot discovery/reporting/deletion for very large Amber suites where unused detection dominates runtime. Prefer --snapshot-warn-unused when you still want unused counted.

    (#1223)


Bug Fixes

  • Deterministic set/dict serialization for partial-order elements — sorting no longer depends on PYTHONHASHSEED for values like homogeneous frozensets (partial order under <), which previously caused flaky snapshots.

    (#1159) — thanks @chuenchen309

  • Preserve skipped single-file snapshots — skipped sibling single-file snapshots are no longer reported as unused or deleted under --snapshot-update.

    (#1161) — thanks @KSmanis

  • JSON datetime.date serialization — dates serialize as ISO dates instead of repr strings.

    (#1216) — thanks @danielnehrig


Performance

  • Improve memory for single-file snapshots — single-file extensions write updates immediately instead of buffering large payloads (e.g. images) until session end. Multi-entry Amber files still batch writes so each .ambr is rewritten once.

    (#1223, closes #1155, #841)

  • Faster unused-snapshot matching on partial selection — unused detection only considers plausible test files, which greatly reduces cost under sharding plugins (e.g. pytest-split).

    (#1207, closes #1193) — thanks @tiagoskaneta

  • Compress xdist snapshot reports — worker→controller snapshot collection payloads are compressed, cutting transfer size for large suites.

    (#1188, fixes #1156) — thanks @w3lld1


Thank you to the contributors

Thank you to everyone who contributed to this release:

  • @chuenchen309 — deterministic Amber sorting; nested path_value matcher fix (first contribution)
  • @KSmanis — skipped single-file snapshot preservation (first contribution)
  • @yangfan-yf-yf — in-memory snapshot(diff=...) baselines; syrupy_snapshot marker (first contribution)
  • @w3lld1 — xdist report compression (first contribution)
  • @tiagoskaneta — unused-snapshot matching performance (first contribution)
  • @danielnehrig — JSON datetime.date serialization