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-updatewhere 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(...) == snapshotAttrs and Pydantic models are unchanged and still need their serializer plugins. See the serializer plugins example.
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.
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 thesnapshotfixture (directly or indirectly) are marked automatically. Update only those tests with:pytest --snapshot-update -m syrupy_snapshot
-
In-memory snapshot diffs —
snapshot(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. -
--snapshot-declaration-order(experimental) — write Amber snapshots in pytest collection/declaration order (including parametrize/idsorder) instead of alphabetical snapshot name order. -
--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-unusedwhen you still want unused counted.(#1223)
Bug Fixes
-
Deterministic set/dict serialization for partial-order elements — sorting no longer depends on
PYTHONHASHSEEDfor values like homogeneousfrozensets (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. -
JSON
datetime.dateserialization — dates serialize as ISO dates instead ofreprstrings.(#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
.ambris rewritten once. -
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.
Thank you to the contributors
Thank you to everyone who contributed to this release:
- @chuenchen309 — deterministic Amber sorting; nested
path_valuematcher fix (first contribution) - @KSmanis — skipped single-file snapshot preservation (first contribution)
- @yangfan-yf-yf — in-memory
snapshot(diff=...)baselines;syrupy_snapshotmarker (first contribution) - @w3lld1 — xdist report compression (first contribution)
- @tiagoskaneta — unused-snapshot matching performance (first contribution)
- @danielnehrig — JSON
datetime.dateserialization