Skip to content

Releases: tophat/syrupy

v4.0.8

20 Jul 21:40
Compare
Choose a tag to compare

4.0.8 (2023-07-20)

Bug Fixes

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

v4.0.7

20 Jul 12:03
Compare
Choose a tag to compare

4.0.7 (2023-07-20)

Bug Fixes

v4.0.6

11 Jul 21:14
Compare
Choose a tag to compare

4.0.6 (2023-07-11)

Bug Fixes

v4.0.5

04 Jul 17:40
Compare
Choose a tag to compare

4.0.5 (2023-07-04)

Bug Fixes

v4.0.4

19 Jun 03:56
Compare
Choose a tag to compare

4.0.4 (2023-06-19)

Bug Fixes

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

v4.0.3

19 Jun 03:25
Compare
Choose a tag to compare

4.0.3 (2023-06-19)

Bug Fixes

v4.0.2

25 Apr 15:02
Compare
Choose a tag to compare

4.0.2 (2023-04-25)

Bug Fixes

v4.0.1

21 Feb 00:26
Compare
Choose a tag to compare

4.0.1 (2023-02-21)

Bug Fixes

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

v4.0.0

02 Feb 20:16
Compare
Choose a tag to compare

4.0.0 (2023-02-02)

NOTE: You will need to regenerate snapshots if using the default Amber serializer. Run pytest --snapshot-update.

Performance

  • Writes no longer occur at assertion time, but are instead queued to happen at the end of the pytest session. This defers IO operations to the end of the test run, however it does increase memory usage. If this presents an issue, we can look at providing an opt-out mechanism for deferred writes. This should also improve pytest-xdist compatibility somewhat.

Breaking Changes

Requirements

  • Min. python version updated to 3.8.1. Since it's possible not everyone will be able to upgrade to Syrupy v4 because of the increase minimum python version, we will consider backporting critical bugs and security vulnerabilities on request (create a GitHub issue).
  • Min. pytest version updated to 7.0.0.

Bug Fixes

  • Removed legacy path usage to support no:legacypath. (#677)

Serializers

  • JSON: None is now serialized as null. (#622)
  • Amber/JSON: Key order of OrderedDicts are now preserved. (#618)
  • Amber: It's now possible to extend the default amber serializer to support numerical sorting of snapshot test cases. An experimental sorted data serializer is available. For an example of how to enable sorting, see test_amber_sort.py. Note that this currently has performance issues which is why it is not the default behaviour. (#657, #683)
  • Amber: A new "# serializer version: 1" line is now written to the top of each ambr file. Adopters of syrupy v4 will receive a message telling the user to regenerate snapshots. As with any major version update, you'll need to run pytest --snapshot-update. This version marker is being placed to make it simpler to support multiple versions of the amber serializer, and thus rollout what has previously been considered breaking changes, without queueing for a major version update.

Extensions API

  • For developers of custom Syrupy extensions, there are a number of changes to the public API of the various extension abstract classes:
    • pre/post read/write hooks have been removed. If you were using these hooks, please open a GitHub issue and we'll consider re-adding them (they had little usage and introduced maintenance complexity).
    • test_location is no longer passed to the constructor of extensions. Instead, it is now an explicit argument of most extension methods.
    • file_extension is now a class property rather than a property instance method.
    • dirname and various other filename related properties have been converted to class methods.
    • Renamed DataSerializer to AmberDataSerializer.
    • 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.

v3.0.6

30 Dec 18:02
Compare
Choose a tag to compare

3.0.6 (2022-12-30)

Bug Fixes

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