unstale

pypi / syrupy

syrupy

What changed in syrupy 5 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-21.

17 breaking9 new APIs and options6 performance1 behavior and defaults2 tooling20 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

syrupy 714 changes

Breaking changes 2

  • Syrupy 7 requires Python 3.11 or later; Python 3.10 is no longer supported.

    7.0.0release notes

  • The experimental opt-in is removed; suites that pass this flag should drop it.

    7.0.0release notes

Performance 1

  • Worker-to-controller snapshot collection payloads use zlib level 1 for faster report compression.

    7.0.0release notes

Behavior and default changes 1

  • Amber write locking turns on automatically when pytest-xdist distributes work; single-process behavior is unchanged.

    7.0.0release notes

Tooling 1

Fixes and other changes 9

  • Snapshot file extensions are now required to be complete.

    7.0.2release notes

  • An empty file_extension no longer crashes the session-finish report, and extensionless discovery no longer claims sibling snapshots with extensions such as .json or .raw.

    7.0.1release notes

  • Truncation reserves space for the dot and extension, preventing long ASCII test names from producing 256-character filenames and keeping truncated filenames tied to their tests.

    7.0.1release notes

  • When pytest runs without a path argument, snapshots for modules excluded from collection with --ignore or pytest_ignore_collect are no longer reported or deleted.

    7.0.1release notes

  • On Windows, lock creation retries when another process has locked the empty region before the sentinel write.

    7.0.0release notes

  • Last-failed runs are treated as partial sessions, so snapshots for tests that did not run are no longer deleted as unused.

    7.0.0release notes

  • Module-level pytest.importorskip() during path discovery no longer turns a skipped session into exit code 1.

    7.0.0release notes

  • Now discovers and removes unused snapshot collections when their owning test modules are gone, including empty per-test-file snapshot directories.

    7.0.0release notes

  • Workers send compressed collected items, and unused delete/fail is skipped when worker reports are incomplete, preventing a dropped worker report from breaking unused detection.

    7.0.0release notes

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

    6.0.0release notes

  • The JSON extension serializes dates as YYYY-MM-DD instead of repr strings, so existing JSON snapshots containing dates need updating.

    6.0.0release notes

  • The Amber serializer now serializes stdlib dataclasses natively; without the former plugin, snapshots may change from repr-style strings to structured Amber form.

    6.0.0release notes

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.

    6.1.1release notes

  • Sets the maximum wait for the snapshot file lock; defaults to 60s.

    6.1.1release notes

  • Experimental option to write Amber snapshots in pytest collection/declaration order, including parametrize/ids order, instead of alphabetical snapshot name order.

    6.0.0release notes

  • snapshot(diff=...) accepts an in-memory baseline object, so tests can diff against data without writing a separate base snapshot.

    6.0.0release notes

  • Skips unused-snapshot discovery, reporting, and deletion, providing an escape hatch for very large Amber suites where unused detection dominates runtime.

    6.0.0release notes

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.

    6.0.0release notes

  • Under partial selection, unused detection considers only plausible test files, reducing its cost with sharding plugins such as pytest-split.

    6.0.0release notes

  • Worker-to-controller snapshot collection payloads are compressed, cutting transfer size for large suites.

    6.0.0release notes

Tooling 1

  • Tests that use the snapshot fixture, directly or indirectly, are marked automatically, allowing snapshot updates to target only those tests.

    6.0.0release notes

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.

    6.0.0release notes

  • Sorting values such as homogeneous frozensets with partial ordering no longer depends on PYTHONHASHSEED, preventing flaky snapshots.

    6.0.0release notes

  • Skipped sibling single-file snapshots are no longer reported as unused or deleted during --snapshot-update.

    6.0.0release notes

syrupy 526 changes

Breaking changes 12

  • Unused snapshots are detected when using pytest-xdist, which may cause test suites that previously passed to fail. --snapshot-warn-unused downgrades detection from an error to a warning.

    5.5.0release notes

  • Renames _file_extension to file_extension as part of the public API naming changes.

    5.0.0release notes

  • Renames _get_file_basename to get_file_basename as part of the public API naming changes.

    5.0.0release notes

  • The minimum required version of pytest is now v8.

    5.0.0release notes

  • Syrupy now requires Python 3.10 or higher; support for Python 3.8 has been dropped.

    5.0.0release notes

  • Renames _read_snapshot_collection to read_snapshot_collection as part of the public API naming changes.

    5.0.0release notes

  • Renames _read_snapshot_data_from_location to read_snapshot_data_from_location as part of the public API naming changes.

    5.0.0release notes

  • Removes SNAPSHOT_DIRNAME in favour of a property on SnapshotCollectionStorage and the associated CLI option.

    5.0.0release notes

  • Renames SNAPSHOT_EMPTY_FOSSIL_KEY to SNAPSHOT_EMPTY_COLLECTION_KEY.

    5.0.0release notes

  • Renames _snapshot_sort_key to snapshot_sort_key as part of the public API naming changes.

    5.0.0release notes

  • Renames SNAPSHOT_UNKNOWN_FOSSIL_KEY to SNAPSHOT_UNKNOWN_COLLECTION_KEY.

    5.0.0release notes

  • Renames _write_snapshot_collection to write_snapshot_collection as part of the public API naming changes.

    5.0.0release notes

New APIs and options 4

  • Keeps unused snapshots on update.

    5.4.0release notes

  • Adds the --snapshot-update-new-only flag.

    5.3.0release notes

  • Adds a serializer plugin system, including plugins for data models.

    5.1.0release notes

  • Adds an option to change the default directory where snapshots are stored.

    5.0.0release notes

Performance 2

  • Serialization avoids copying the cycle-detection set on every serialized node.

    5.3.3release notes

  • String serialization in the amber serializer is faster.

    5.3.3release notes

Fixes and other changes 8

  • Fixes detection of pytest-xdist when it is loaded via PYTEST_PLUGINS.

    5.5.2release notes

  • Defers registering the pytest-xdist hook to avoid an “unknown hook” error.

    5.5.1release notes

  • Honors boolean operators in snapshot selection.

    5.4.0release notes

  • Color control no longer mutates os.environ.

    5.3.4release notes

  • Serialization now handles unicode line-endings correctly.

    5.2.0release notes

  • The project switched to the MIT license for versions 5.0.0 and beyond; versions 4.x or earlier retain the previous Apache 2.0 license.

    5.0.0release notes

  • Ensures Syrupy's assertion hook is called first, improving compatibility with other plugins.

    5.0.0release notes

  • Fixes the terminal summary display when using xdist workers.

    5.0.0release notes