Skip to content

Latest commit

 

History

History
1020 lines (503 loc) · 50.8 KB

File metadata and controls

1020 lines (503 loc) · 50.8 KB

Changelog

All notable changes to this project will be documented in this file.

v5.5.3 (2026-07-11)

What's Changed

  • chore(deps): update astral-sh/setup-uv action to v8.3.0 by @renovate[bot] in #1143
  • chore(deps): update astral-sh/setup-uv action to v8.3.1 by @renovate[bot] in #1145
  • chore(deps): update dependency hypothesis to v6.156.2 by @renovate[bot] in #1147
  • chore(deps): update dependency mypy to v2.2.0 by @renovate[bot] in #1148
  • chore(deps): update dependency hypothesis to v6.156.3 by @renovate[bot] in #1150
  • chore: closes #1144 by @noahnu in #1146
  • chore(deps): update astral-sh/setup-uv action to v8.3.2 by @renovate[bot] in #1149

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.5.2...v5.5.3

v5.5.2 (2026-07-08)

What's Changed

  • fix: Fix detecting pytest-xdist when loaded via PYTEST_PLUGINS by @mgorny in #1142

New Contributors

  • @mgorny made their first contribution in #1142

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.5.1...v5.5.2

v5.5.1 (2026-07-06)

What's Changed

  • fix: Defer registering pytest-xdist hook pytest_testnodedown to avoid "unknown hook" error by @edgarrmondragon in #1140

New Contributors

  • @edgarrmondragon made their first contribution in #1140

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.5.0...v5.5.1

v5.5.0 (2026-07-06)

What's Changed

  • feat: detect unused snapshots under pytest-xdist by @frenck in #1132

NOTE: Test suites using pytest-xdist that previously passed due to incomplete snapshot support may now fail if unused snapshots are detected. You can use --snapshot-warn-unused to downgrade unused snapshot detection from an error to a warning though it's not recommended.

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.4.0...v5.5.0

v5.4.0 (2026-07-01)

What's Changed

  • feat: add --snapshot-no-cleanup to keep unused snapshots on update by @frenck in #1126
  • fix: honor boolean operators in -k snapshot selection by @frenck in #1127

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.3.4...v5.4.0

v5.3.4 (2026-06-26)

What's Changed

  • perf: drop per-node kwargs dict from the amber serializer by @frenck in #1122
  • perf: give the internal matcher wrapper an explicit signature by @frenck in #1121
  • fix: avoid os.environ mutation for color control by @frenck in #1125

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.3.3...v5.3.4

v5.3.3 (2026-06-25)

What's Changed

  • perf: speed up string serialization in amber serializer by @frenck in #1118
  • perf: avoid copying the cycle-detection set on every serialized node by @frenck in #1119

New Contributors

  • @TejasAmle made their first contribution in #1113
  • @frenck made their first contribution in #1118

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.3.2...v5.3.3

v5.3.2 (2026-06-09)

What's Changed

  • fix: overlapping test filenames across directories by @noahnu in #1104

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.3.1...v5.3.2

v5.3.1 (2026-05-31)

What's Changed

Fixes

  • fix(test): mark pydantic and attrs as dependencies for running internal tests by @noahnu in #1108 -- This only affects users trying to run the syrupy tests themselves, not consumers of syrupy.

Misc

  • chore(deps): update astral-sh/setup-uv action to v8.1.0 by @renovate[bot] in #1103
  • chore(deps): update python docker tag to v3.14.4 by @renovate[bot] in #1102
  • chore(deps): update benchmark-action/github-action-benchmark action to v1.22.1 by @renovate[bot] in #1105

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.3.0...v5.3.1

v5.3.0 (2026-05-31)

What's Changed

Features

  • feat: add --snapshot-update-new-only flag (#843) by @SAY-5 in #1098

Misc.

  • chore: move release marker by @noahnu in #1095
  • chore(deps): update codecov/codecov-action action to v5.5.4 by @renovate[bot] in #1089
  • chore(deps): update dependency pytest to v9.0.3 by @renovate[bot] in #1096
  • fix: include tests in sdist by @Lovlace777 in #1099
  • chore: skip benchmark on forks by @noahnu in #1100
  • chore: update dev dependencies by @noahnu in #1101

New Contributors

  • @Lovlace777 made their first contribution in #1099
  • @SAY-5 made their first contribution in #1098

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.2.0...v5.3.0

v5.2.0 (2026-05-16)

What's Changed

  • chore(deps): update actions/checkout action to v6.0.2 by @renovate[bot] in #1065
  • chore(deps): update actions/setup-python action to v6.2.0 by @renovate[bot] in #1066
  • chore(deps): update dependency ruff to v0.14.14 by @renovate[bot] in #1067
  • chore(deps): update dependency coverage to v7.13.2 by @renovate[bot] in #1068
  • chore: migrate to uv, close #1019 by @noahnu in #1049
  • chore(deps): update dependency coverage to v7.13.2 by @renovate[bot] in #1069
  • chore(deps): update dependency debugpy to v1.8.19 by @renovate[bot] in #1070
  • chore(deps): update dependency mypy to v1.19.1 by @renovate[bot] in #1071
  • chore(deps): update dependency ruff to v0.14.14 by @renovate[bot] in #1072
  • chore(deps): update python docker tag to v3.14.3 by @renovate[bot] in #1073
  • chore(deps): update astral-sh/setup-uv action to v7.3.1 by @renovate[bot] in #1076
  • chore: update lock file by @noahnu in #1077
  • chore(deps): update benchmark-action/github-action-benchmark action to v1.21.0 by @renovate[bot] in #1078
  • chore(deps): update astral-sh/setup-uv action to v7.5.0 by @renovate[bot] in #1080
  • fix(#1081): Handle unicode line-endings correctly when serializing by @DRMacIver in #1082
  • docs: add DRMacIver as a contributor for bug by @allcontributors[bot] in #1083
  • chore: update lockfile by @noahnu in #1086
  • chore: migrate off semantic-release to trusted publishing by @noahnu in #1093
  • chore: set name/email by @noahnu in #1094

New Contributors

  • @DRMacIver made their first contribution in #1082

Full Changelog: https://github.com/syrupy-project/syrupy/compare/v5.1.0...v5.2.0

5.1.2 (2026-04-06)

Bug Fixes

5.1.1 (2026-04-06)

Bug Fixes

  • #1081: Handle unicode line-endings correctly when serializing (#1082) (04f4cc8), closes #1081

5.1.0 (2026-01-25)

Features

  • add serializer plugin system; plugins for data models (#1062) (df9bc8f)

5.0.0 (2025-09-28)

Bug Fixes

  • Block terminal summary for xdist workers. (#978) (33a848d)
  • ensure syrupy's pytest_assertrepr_compare hook is called first. (#984) (eb0024d)

Code Refactoring

  • remove incorrect private underscore prefix from public methods (8cfc905)

Features

  • add --snapshot-dirname option, close #810 (27135c7)
  • drop support for py3.8, raise min. pytest to v8 (#904) (a879ff1)
  • update min. python version to 3.10 (#1024) (16b4113)

BREAKING CHANGES

  • The following methods have been renamed:

SnapshotCollectionStorage

  • _read_snapshot_collection -> read_snapshot_collection
  • _read_snapshot_data_from_location -> read_snapshot_data_from_location
  • _write_snapshot_collection -> write_snapshot_collection
  • _get_file_basename -> get_file_basename
  • _file_extension -> file_extension

AmberDataSerializer

  • _snapshot_sort_key -> snapshot_sort_key

Renamed constants to improve clarity:

constants

  • SNAPSHOT_EMPTY_FOSSIL_KEY -> SNAPSHOT_EMPTY_COLLECTION_KEY
  • SNAPSHOT_UNKNOWN_FOSSIL_KEY -> SNAPSHOT_UNKNOWN_COLLECTION_KEY
  • Min. python version is now 3.10.
  • The Syrupy project is switching from Apache 2.0 to a more permissive MIT license. By using Syrupy >=5, you agree to abide by this new license. You can continue to use Syrupy v1 through v4 under Apache 2.0.
  • Drops support for Python 3.8 which is end of life as of October 2024. Raises the minimum version of pytest to v8.

4.9.1 (2025-03-24)

Bug Fixes

  • serializer: preserve trailing newlines in ambr serialization (#950) (5897490)
  • serializer: preserve trailing newlines in ambr serialization (#950) (5037477)

4.9.0 (2025-03-08)

Bug Fixes

  • serializer: raise TypeError when serializing non-byte like object in binary mode (#951) (2bd0f54)

Features

  • add --snapshot-ignore-file-extensions argument to support DVC (#943) (056cc6e)
  • add compose_matchers utility for composing 1 or more matchers (#952) (157dbec)
  • add SingleFileAmberSnapshotExtension as a single-file variant of the default amber extension (#959) (a753b7a)
  • include details about created/updated snapshots in detailed report (#942) (25d37ef)

4.8.3 (2025-03-08)

Bug Fixes

  • snapshots of deselected parametrized tests wrongly marked as unused (#965) (52f3bb2)

4.8.2 (2025-02-20)

Bug Fixes

  • avoid unnecessary env updates to reduce chances of segfault (#956) (7fdffd9)

4.8.1 (2025-01-13)

Bug Fixes

  • check current session's pending-write queue when recalling snapshots (e.g. diffing) (#927) (0f6bb55)

4.8.0 (2024-11-23)

Features

4.7.2 (2024-10-06)

Bug Fixes

4.7.1 (2024-08-23)

Bug Fixes

4.7.0 (2024-08-23)

Features

  • Added a new CLI flag: --snapshot-patch-pycharm-diff (a4dfcf5)

4.6.4 (2024-08-21)

Bug Fixes

  • relax python version constraint, remove upperbound (#878) (05a35a1)

4.6.3 (2024-08-21)

Bug Fixes

  • ignore unused snapshots for skipped test (#862) (3f6e301)

4.6.2 (2024-08-21)

Bug Fixes

4.6.2 (2024-08-21)

Bug Fixes

4.6.1 (2024-02-07)

Bug Fixes

4.6.0 (2023-10-24)

Features

  • serializer: add support for FunctionType serialization (#823) (f3a454a)

4.5.0 (2023-09-01)

Features

4.4.0 (2023-08-29)

Features

4.3.0 (2023-08-28)

Features

  • add include option to snapshots, similar to exclude (#797) (d3f891e)

4.2.2 (2023-08-28)

Bug Fixes

4.2.1 (2023-08-21)

Bug Fixes

4.2.0 (2023-08-21)

Features

  • serializer: add snapshot regex value matcher and bypass custom repr helper (#791) (3ac2ce8)

4.1.1 (2023-08-17)

Bug Fixes

  • preserve Falsy values in assertion diff function (#789) (118ef92)

4.1.0 (2023-08-16)

Features

  • amber: expose serialize_custom_iterable method of AmberDataSerializer (#788) (d210cf1)

4.0.8 (2023-07-20)

Bug Fixes

  • diffing excessively large snapshot lines (#778) (64b4265)

4.0.7 (2023-07-20)

Bug Fixes

4.0.6 (2023-07-11)

Bug Fixes

4.0.5 (2023-07-04)

Bug Fixes

4.0.4 (2023-06-19)

Bug Fixes

  • incorrect marking of TestClass.test_method as unused, close #717 (#761) (0badfdb)

4.0.3 (2023-06-19)

Bug Fixes

4.0.2 (2023-04-25)

Bug Fixes

4.0.1 (2023-02-21)

Bug Fixes

  • serializer: handling of multi-part file extensions in SingleFileExtension (#710) (efe687e)

4.0.0 (2023-02-02)

Bug Fixes

  • defer snapshot writes until end of session (#606) (68f1d5f)
  • ensure all pytest options are serializable (#667) (e8ed9f2)
  • improve pytest-xdist compatibility (9b9090f)
  • lru_cache on snapshot reads (#629) (c1a675f)
  • remove legacy path usage to support no:legacypath, closes #677 (#684) (6385979)

Code Refactoring

  • simplify data serializer for ambr (#676) (3d296e1)
  • write performance improvements, api clarity (#645) (2c31c39)

Features

  • json: serialize None as null, close #622 (c330680)
  • numerically sort snapshots if possible, close #657 (4ca0716)
  • serializer: preserve key ordering of OrderedDict (0a2289a)
  • support overriding the amber serializer class (#683) (662c93f)
  • update python version, pytest version (#658) (c360b95)

BREAKING CHANGES

  • Serializers may now throw a TaintedSnapshotError which will tell the user to regenerate the snapshot even if the underlying data has not changed. This is to support rolling out more subtle changes to the serializers, such as the introduction of serializer metadata.

  • Renamed DataSerializer to AmberDataSerializer.

  • serializer: Key order is now preserved if using OrderedDict in both the Amber serializer and JSON serializer.

  • json: The JSONSnapshotExtension now serializes Python's None as "null" rather than "None".

  • Raise minimum python version to 3.8.1 and min. pytest version to v7.

  • PyTestLocation.filename has been renamed to .basename

  • refactor: add test_location kwarg to get_snapshot_name

  • refactor: get_snapshot_name is now static as a classmethod

  • refactor: remove pre and post read/write hooks

  • Pre and post read/write hooks have been removed without replacement to make internal refactor simpler. Please open a GitHub issue if you have a use case for these hooks.

  • refactor: rename Fossil to Collection

  • The term 'fossil' has been replaced by the clearer term 'collection'.

  • refactor: pass test_location to read_snapshot

  • refactor: remove singular write_snapshot method

  • refactor: dirname property to method

  • refactor: pass test_location to discover_snapshots

  • refactor: remove usage of self.test_location

  • refactor: make write_snapshot a classmethod

  • refactor: do not instantiate extension with test_location

  • Numerous instance methods have been refactored as classmethods.

3.0.6 (2022-12-30)

Bug Fixes

  • ensure all pytest options are serializable (#667) (e320d7b)
  • improve pytest-xdist compatibility (8739194)

3.0.5 (2022-11-08)

Bug Fixes

  • only instantiate colored objects if color is not disabled (#634) (7f0fe22)

3.0.4 (2022-11-03)

Bug Fixes

3.0.3 (2022-11-03)

Bug Fixes

  • use more expressive glob when building whl (#627) (6a766e7)

3.0.2 (2022-09-23)

Bug Fixes

  • update classifiers (no material change) (43d78ec)

3.0.1 (2022-09-23)

Bug Fixes

  • avoid reporting crash for snapshot dir outside pytest dir (#621) (f2b2e77)

3.0.0 (2022-08-11)

Features

BREAKING CHANGES

  • Drop Python 3.6 support due to end of life.

2.3.1 (2022-07-07)

Bug Fixes

  • ignore test_a_suffix snapshots when running test_a (#607) (988a8ab)

2.3.0 (2022-05-12)

Features

2.2.0 (2022-05-12)

Features

2.1.0 (2022-05-11)

Features

2.0.0 (2022-04-10)

Features

BREAKING CHANGES

  • amber: update to serialization requires regeneration of snapshots

Migration Guide

  • pytest --snapshot-update to regenerate amber snapshots

1.7.4 (2022-02-16)

Bug Fixes

1.7.3 (2022-01-25)

Bug Fixes

  • json: use additional forward references for py3.7 (#587) (8489e93)

1.7.2 (2022-01-25)

Bug Fixes

  • json: use forward references for py3.7 compatibility (#586) (8f0db02)

1.7.1 (2022-01-25)

Bug Fixes

1.7.0 (2022-01-14)

Bug Fixes

  • ignore, this commit is to force a release (effeadb)

Features

  • add JSON extension as alternative to amber (b366082)

1.6.0 (2022-01-14)

Features

  • allow extensions to override snapshot equality check (#548) (a44f1b9)

1.5.0 (2021-11-03)

Features

1.4.7 (2021-10-13)

Bug Fixes

  • NameError when importing SingleFileSnapshotExtension (#557) (935e256)

1.4.6 (2021-10-06)

Bug Fixes

  • typo in single file extension error message (#553) (c4785f8)

1.4.5 (2021-08-29)

Bug Fixes

1.4.4 (2021-08-20)

Performance Improvements

  • memoise DataSerializer.read_file results (#543) (df5b516)

1.4.3 (2021-08-20)

Performance Improvements

  • cache session snapshot extension discovery (#542) (10cfc90)

1.4.2 (2021-08-18)

Performance Improvements

  • discover snapshots once per file rather than per assertion (#541) (84c8b82)

1.4.1 (2021-08-18)

Bug Fixes

  • unused snapshot not filtered out when tests have similar names, close #529 (#531) (d0c8ca8)

1.4.0 (2021-08-02)

Features

1.3.1 (2021-06-20)

Bug Fixes

1.3.0 (2021-06-05)

Features

  • types: explicit property matcher and filter types kwargs (#515) (8dddebf)

1.2.4 (2021-06-01)

Bug Fixes

  • correctly use pytest invocation arguments (#507) (8b511e5)

1.2.3 (2021-05-12)

Bug Fixes

1.2.2 (2021-03-18)

Features

  • option to report details of unused snapshots (#467), close #465 (1c50db0)

1.1.0 (2020-12-01)

Features

  • add PEP-561 py.typed file for downstream type checkers (#440) (fe15bdb), closes #439

1.0.0 (2020-11-13)

Features

BREAKING CHANGES

  • Release v1.0.0

0.9.0 (2020-11-13)

Features

  • expand single filename legal characters (#398) (302916b)

0.8.4 (2020-10-30)

Performance Improvements

  • optimise session items data structures (#403) (818d405)

0.8.3 (2020-10-30)

Bug Fixes

  • assertion exception shows error at correct location (#402) (d46bba4)
  • only perform session finish on test items ran (#401) (61a670f)

0.8.2 (2020-10-30)

Bug Fixes

  • unused snapshot detection for targeting single parameterized test case (#394) (e008935)

0.8.1 (2020-10-29)

Bug Fixes

0.8.0 (2020-10-27)

Features

  • amber: normalise line endings between operating systems (#377) (82b624d)

BREAKING CHANGES

  • Line control characters are normalised when snapshots are generated i.e. \r and \n characters are all written as \n. This is to allow interoperability of snapshots between operating systems that use disparate line control characters.

0.7.2 (2020-09-20)

Bug Fixes

0.7.1 (2020-09-05)

Bug Fixes

0.7.0 (2020-08-24)

Features

0.6.1 (2020-07-29)

Bug Fixes

0.6.0 (2020-07-12)

Features

0.5.2 (2020-07-09)

Bug Fixes

  • amber: Do not add empty line to empty iterables (#287) (0b4a9b0)

0.5.1 (2020-06-12)

Bug Fixes

  • support ignoring fields when serializing (#262) (f67268e)

0.5.0 (2020-06-09)

Features

0.4.4 (2020-06-02)

Bug Fixes

0.4.3 (2020-05-27)

Bug Fixes

  • Update setup.py, so that it allows for any Python 3.6+ version to be used (25c2688)

0.4.2 (2020-04-22)

Bug Fixes

  • Handle dotted parameters in classname (#200) (d961f7c)

0.4.1 (2020-04-19)

Bug Fixes

  • specify encoding when reading and writing amber fossils (#198) (a6a53c4)

0.4.0 (2020-04-19)

Bug Fixes

  • remove added trailing whitespace from multiline string (24f3d57)

Features

0.3.12 (2020-04-19)

Bug Fixes

  • use the test node location when determining snapshot class name (#197) (1010c94)

0.3.11 (2020-04-17)

Bug Fixes

  • show snapshot data in report when does not exist (#191) (7ebdca2)

0.3.10 (2020-04-15)

Bug Fixes

0.3.9 (2020-04-08)

Bug Fixes

  • correctly track unused snapshots in classes (#177) (f780501)

0.3.8 (2020-04-03)

Performance Improvements

  • only clear assertion _extension when overridden (#172) (82eae91)

0.3.7 (2020-03-24)

Bug Fixes

  • support call syntax for snapshot fixture overriding (#160) (4cf051c)

0.3.6 (2020-03-10)

Bug Fixes

  • specify correct min version of pytest (#157) (858bec7)

0.3.5 (2020-03-08)

Bug Fixes

  • snapshot name warning showing on false negatives (#151) (d56860b)

0.3.4 (2020-03-08)

Bug Fixes

  • show hidden line characters and accessible colors (#126) (fa442df), closes #150
  • Conversion of all os.path and os.walk calls to use pathlib instead, setting pathlib as the new preferred way of doing path operations (#130)
  • Add --snapshot-default-extension option to specify extension class via pytest cli (#132)
  • Fix bug where snapshot diffs were erroneously printed (#135)
  • Fix bug where snapshot names were incorrectly matching tests (#136)
  • Fix bug where deleted snapshots where incorrectly colored (#136)
  • Fix bug where targeting specific test nodes did not filter out unused snapshots (#139)
  • Fix bug where snapshot report was printed out before the pytest report (#144)
  • Fix bug where untargeted snapshots would be deleted when using pytest in targeted mode (#123)
  • Fix bug where snapshot files were not cleaned up when running specific test files (#127)
  • Fix bug where targeting specific test nodes in a test file was not supported (#127)
  • Fix bug where targeting specific test modules using pyargs was not supported (#127)
  • Fix bug where newline control characters were being translated based on platform (#113)
  • Adds support for named tuple fields (#108)
  • Add trailing commas to class fields (#108)
  • Specify explicit version range for pytest peer dependency (#111)
  • Fix issue with using hashables as dict keys or in sets (#103)
  • Add support for custom objects repr (#101)
  • Add support for nested test classes (#99)
  • Remove _snapshot_subdirectory_name from SnapshotFossilizer (#99)