pypi / syrupy
syrupy
What changed in syrupy 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.
3 breaking5 new APIs and options3 performance1 tooling3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsyrupy 615 changes
Breaking changes 3
The separate DataclassPlugin has been removed; remove its imports and plugin wiring because stdlib dataclasses are serialized natively by the Amber serializer.
The JSON extension serializes dates as YYYY-MM-DD instead of repr strings, so existing JSON snapshots containing dates need updating.
The Amber serializer now serializes stdlib dataclasses natively; without the former plugin, snapshots may change from repr-style strings to structured Amber form.
New APIs and options 5
Experimental opt-in for pytest-xdist that uses an exclusive file lock and atomic replace around amber writes to prevent workers from dropping snapshots.
Sets the maximum wait for the snapshot file lock; defaults to 60s.
Experimental option to write Amber snapshots in pytest collection/declaration order, including parametrize/ids order, instead of alphabetical snapshot name order.
snapshot(diff=...) accepts an in-memory baseline object, so tests can diff against data without writing a separate base snapshot.
Skips unused-snapshot discovery, reporting, and deletion, providing an escape hatch for very large Amber suites where unused detection dominates runtime.
Performance 3
Single-file extensions write updates immediately instead of buffering large payloads until session end, improving memory use; multi-entry Amber files still batch writes.
Under partial selection, unused detection considers only plausible test files, reducing its cost with sharding plugins such as pytest-split.
Worker-to-controller snapshot collection payloads are compressed, cutting transfer size for large suites.
Tooling 1
Tests that use the snapshot fixture, directly or indirectly, are marked automatically, allowing snapshot updates to target only those tests.
Fixes and other changes 3
With regex=False, path_value now replaces values at nested paths such as user.token; previously, default-mode lookup missed escaped path keys.
Sorting values such as homogeneous frozensets with partial ordering no longer depends on PYTHONHASHSEED, preventing flaky snapshots.
Skipped sibling single-file snapshots are no longer reported as unused or deleted during --snapshot-update.