From 295ccec4408164499a926a66459f0b1bc6159e9d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 26 Jul 2025 16:15:33 +1000 Subject: [PATCH 1/2] Skip pyroma test if git is not available --- Tests/test_pyroma.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/test_pyroma.py b/Tests/test_pyroma.py index c2f7fe22ecb..06aa8818c82 100644 --- a/Tests/test_pyroma.py +++ b/Tests/test_pyroma.py @@ -1,5 +1,7 @@ from __future__ import annotations +import shutil + import pytest from PIL import __version__ @@ -7,6 +9,7 @@ pyroma = pytest.importorskip("pyroma", reason="Pyroma not installed") +@pytest.mark.skipif(not shutil.which("git"), reason="Git is used by check-manifest") def test_pyroma() -> None: # Arrange data = pyroma.projectdata.get_data(".") From 7f19e1cba9b18899f5f486cf9f74f21a8c6a6659 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 26 Jul 2025 16:12:47 +1000 Subject: [PATCH 2/2] Catch error when removing temporary file --- Tests/test_image_access.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/test_image_access.py b/Tests/test_image_access.py index a847264d27e..013a242323e 100644 --- a/Tests/test_image_access.py +++ b/Tests/test_image_access.py @@ -317,4 +317,7 @@ def test_embeddable(self) -> None: assert process.returncode == 0 def teardown_method(self) -> None: - os.remove("embed_pil.c") + try: + os.remove("embed_pil.c") + except FileNotFoundError: + pass