fix(serializer): preserve trailing newlines in ambr serialization#950
Merged
fix(serializer): preserve trailing newlines in ambr serialization#950
Conversation
noahnu
commented
Feb 17, 2025
| if test_name and snapshot_data: | ||
| yield Snapshot( | ||
| name=test_name, | ||
| data=snapshot_data.rstrip(os.linesep), |
Collaborator
Author
There was a problem hiding this comment.
We were trimming too much. Only meant to trim the last char
Codecov ReportAttention: Patch coverage is @@ Coverage Diff @@
## next #950 +/- ##
==========================================
- Coverage 97.83% 97.77% -0.07%
==========================================
Files 21 21
Lines 1616 1617 +1
==========================================
Hits 1581 1581
- Misses 35 36 +1 |
BREAKING CHANGE: Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: b77b005 | Previous: b7f5a9d | Ratio |
|---|---|---|---|
benchmarks/test_1000x.py::test_1000x_reads |
0.7738313676687634 iter/sec (stddev: 0.07879161063425968) |
0.7985141212181278 iter/sec (stddev: 0.05282275712328596) |
1.03 |
benchmarks/test_1000x.py::test_1000x_writes |
0.6639295546681687 iter/sec (stddev: 0.2627945070184551) |
0.698901352248691 iter/sec (stddev: 0.24551960819132626) |
1.05 |
benchmarks/test_standard.py::test_standard |
0.6855419304758074 iter/sec (stddev: 0.10011401104717381) |
0.7294161208407376 iter/sec (stddev: 0.06718845368778603) |
1.06 |
This comment was automatically generated by workflow using github-action-benchmark.
noahnu
added a commit
that referenced
this pull request
Feb 20, 2025
BREAKING CHANGE: Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
noahnu
added a commit
that referenced
this pull request
Mar 8, 2025
BREAKING CHANGE: Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
noahnu
added a commit
that referenced
this pull request
Mar 8, 2025
BREAKING CHANGE: Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
noahnu
added a commit
that referenced
this pull request
Mar 24, 2025
Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
noahnu
added a commit
that referenced
this pull request
Mar 24, 2025
Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
noahnu
added a commit
that referenced
this pull request
Mar 24, 2025
wpbonelli
pushed a commit
to wpbonelli/syrupy
that referenced
this pull request
Jun 19, 2025
## [4.9.1](syrupy-project/syrupy@v4.9.0...v4.9.1) (2025-03-24) ### Bug Fixes * **serializer:** preserve trailing newlines in ambr serialization ([syrupy-project#950](syrupy-project#950)) ([5897490](syrupy-project@5897490)) * **serializer:** preserve trailing newlines in ambr serialization ([syrupy-project#950](syrupy-project#950)) ([5037477](syrupy-project@5037477))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: Trailing newlines are now preserved in amber serialization. This mostly affects serialization of custom repr implementations.
Closes #925