Skip to content

Commit

Permalink
Avoid newline problems on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Oct 23, 2024
1 parent 97af980 commit 2924da8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setuptools/tests/test_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,12 @@ def _assert_roundtrip_message(metadata: str) -> None:
out = io.TextIOWrapper(buffer, encoding="utf-8")
Generator(out, policy=serialization_policy).flatten(msg)
out.flush()
regenerated = buffer.getvalue()
regenerated = buffer.getvalue().splitlines()

raw_metadata = bytes(metadata, "utf-8")
# Normalise newlines to avoid test errors on Windows:
raw_metadata = b"\n".join(raw_metadata.splitlines())
regenerated = b"\n".join(regenerated.splitlines())
assert regenerated == raw_metadata


Expand Down

0 comments on commit 2924da8

Please sign in to comment.