From 376427184e4c06341f6a43ad1c478262d6d2e297 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Fri, 24 Mar 2023 18:56:35 +0000 Subject: [PATCH] Fix sha of WHEEL file in test for wheelbuilder --- setuptools/tests/test_wheelbuilder.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setuptools/tests/test_wheelbuilder.py b/setuptools/tests/test_wheelbuilder.py index 4723806165..94193c91fa 100644 --- a/setuptools/tests/test_wheelbuilder.py +++ b/setuptools/tests/test_wheelbuilder.py @@ -26,14 +26,19 @@ def test_write_str(tmp_path): assert infolist[2].filename == "test-1.0.dist-info/WHEEL" assert infolist[3].filename == "test-1.0.dist-info/RECORD" - record = zf.read("test-1.0.dist-info/RECORD") + record = "\n".join( + line + for line in str(zf.read("test-1.0.dist-info/RECORD"), "utf-8").splitlines() + if not line.startswith("test-1.0.dist-info/WHEEL") + # Avoid changes in setuptools versions messing with the test + ) + expected = """\ hello/héllö.py,sha256=bv-QV3RciQC2v3zL8Uvhd_arp40J5A9xmyubN34OVwo,25 "hello/h,ll,.py",sha256=bv-QV3RciQC2v3zL8Uvhd_arp40J5A9xmyubN34OVwo,25 - test-1.0.dist-info/WHEEL,sha256=NQO4GQhpskiOxMaJNXoSMmqqiP8mLs4mkxW8zYE9nzo,100 test-1.0.dist-info/RECORD,, """ - assert str(record, "utf-8") == textwrap.dedent(expected) + assert record.strip() == textwrap.dedent(expected).strip() def test_timestamp(tmp_path_factory, tmp_path, monkeypatch):