Syrupy

Latest version: v4.6.1

Safety actively analyzes 638466 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 17

4.0.0

[4.0.0](https://github.com/tophat/syrupy/compare/v3.0.6...v4.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](https://github.com/tophat/syrupy/blob/f416e9a408bc252fdeab1888cb8b7f0cd8fdef92/tests/syrupy/extensions/amber_sorted/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.

3.0.6

[3.0.6](https://github.com/tophat/syrupy/compare/v3.0.5...v3.0.6) (2022-12-30)


Bug Fixes

* ensure all pytest options are serializable ([667](https://github.com/tophat/syrupy/issues/667)) ([e320d7b](https://github.com/tophat/syrupy/commit/e320d7b799b7890df5a63eda59a1382a3d73f39b))
* improve pytest-xdist compatibility ([8739194](https://github.com/tophat/syrupy/commit/87391946af859bbe9a63c5ac297cfc7b169c7742))

3.0.5

[3.0.5](https://github.com/tophat/syrupy/compare/v3.0.4...v3.0.5) (2022-11-08)


Bug Fixes

* only instantiate colored objects if color is not disabled ([634](https://github.com/tophat/syrupy/issues/634)) ([7f0fe22](https://github.com/tophat/syrupy/commit/7f0fe2255e56cafbad86f6e505019b8e507afd00))

3.0.4

[3.0.4](https://github.com/tophat/syrupy/compare/v3.0.3...v3.0.4) (2022-11-03)


Bug Fixes

* update poetry build backend ([631](https://github.com/tophat/syrupy/issues/631)) ([4819026](https://github.com/tophat/syrupy/commit/48190261f31ee801d60daab046e37d6a910b3efc))

3.0.3

[3.0.3](https://github.com/tophat/syrupy/compare/v3.0.2...v3.0.3) (2022-11-03)


Bug Fixes

* use more expressive glob when building whl ([627](https://github.com/tophat/syrupy/issues/627)) ([6a766e7](https://github.com/tophat/syrupy/commit/6a766e78d72fd3e74cc7725fead46b7f839b468a))

3.0.2

[3.0.2](https://github.com/tophat/syrupy/compare/v3.0.1...v3.0.2) (2022-09-23)


Bug Fixes

* update classifiers (no material change) ([43d78ec](https://github.com/tophat/syrupy/commit/43d78ecc0a2175487db1c9bf5857d6ee34344046))

Page 4 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.