Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline strings within dicts contain extra trailing whitespace in snapshots #183

Closed
noahnu opened this issue Apr 14, 2020 · 1 comment · Fixed by #192
Closed

Multiline strings within dicts contain extra trailing whitespace in snapshots #183

noahnu opened this issue Apr 14, 2020 · 1 comment · Fixed by #192
Assignees
Labels
bug Something isn't working released
Milestone

Comments

@noahnu
Copy link
Collaborator

noahnu commented Apr 14, 2020

Describe the bug

Multiline strings in a dictionary are serialized with extra trailing whitespace.

To Reproduce

test_file.py

def test_lines(snapshot):
    lines = "\n".join([
        "line 1",
        "line 2",
        "line 3"
    ])
    assert { "value": lines } == snapshot

Output (whitespace highlighted):

image

Expected behavior

Trailing whitespace should only be included if it's actually present in the data that is serialized.

Desktop (please complete the following information):

  • Syrupy 0.3.9
  • Python 3.8.1

Additional context

The amount of trailing whitespace seems to vary. Might be based on indentation, haven't looked into it too much.

This is consistent behaviour and thus does not "break" anything, and thus fixing this would require a breaking change.

@noahnu noahnu added the bug Something isn't working label Apr 14, 2020
@noahnu noahnu added this to the v1.0.0 milestone Apr 14, 2020
@noahnu noahnu self-assigned this Apr 14, 2020
@noahnu noahnu modified the milestones: v1.0.0, v0.4.0 Apr 17, 2020
@syrupy-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
2 participants