From 1c00d3fa7b918ee17ff9060db23450c6cbc0e511 Mon Sep 17 00:00:00 2001 From: Anna Singleton Date: Mon, 26 Jan 2026 16:29:25 +0000 Subject: [PATCH 1/2] fix: support 'convert' as well as 'magick' style imagemagick cmds for tests --- tests/functional/conftest.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 0d96499..998f4df 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -92,10 +92,11 @@ def valid_formatted_image( tmp_path_factory: pytest.TempPathFactory, ) -> bytes: image_format = request.param - if (magick_path := shutil.which("magick")) is None: + if ((magick_path := shutil.which("magick")) is None and + (magick_path := shutil.which("convert")) is None): pytest.fail( - "ImageMagick 'magick' command not found - cannot run " - "multi-format test" + "ImageMagick 'magick' or 'convert' command not found - cannot " + "run multi-format test" ) image_dir = tmp_path_factory.mktemp("images") @@ -119,9 +120,9 @@ def valid_formatted_image( image_path = image_dir / f"test_image.{image_format}" if not image_path.exists(): - cmd = f'magick "{base_image_path}" "{image_path}"' + cmd = [magick_path, str(base_image_path), str(image_path)] _ = subprocess.run( # noqa: S603 - false positive :( - [magick_path, str(base_image_path), str(image_path)], + cmd, check=True, shell=False, ) From e405693171ffb99f6bf6e625356e6a8435718ffb Mon Sep 17 00:00:00 2001 From: anna-singleton-resolver Date: Mon, 26 Jan 2026 16:40:27 +0000 Subject: [PATCH 2/2] style: lint --- tests/functional/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index 998f4df..e7cd324 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -92,8 +92,9 @@ def valid_formatted_image( tmp_path_factory: pytest.TempPathFactory, ) -> bytes: image_format = request.param - if ((magick_path := shutil.which("magick")) is None and - (magick_path := shutil.which("convert")) is None): + if (magick_path := shutil.which("magick")) is None and ( + magick_path := shutil.which("convert") + ) is None: pytest.fail( "ImageMagick 'magick' or 'convert' command not found - cannot " "run multi-format test"