Describe the bug
When generating snapshots from mutliline strings the text is idented in the snapshot file. This means that empty lines in multiline strings generate lines containing only (trailling) whitespace in the line.
Trimming this whitespace then invalidates the snapshot causing the test to fail.
To reproduce
def test(snapshot):
lines = "\n".join([
"line 1",
"", # empty string
"line 3"
])
assert lines == snapshot
This test passes fine.
Then trim trailing whitespace on the generated snapshot.
Now the test fails.
Expected behavior
Snapshot files shouldn't have meaningful trailing whitespace.