Skip to content

Commit fb07a25

Browse files
feat: Handle ImageMagick 6 and 7 command names in tests
1 parent 347c3f9 commit fb07a25

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/functional/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ def valid_formatted_image(
9292
tmp_path_factory: pytest.TempPathFactory,
9393
) -> bytes:
9494
image_format = request.param
95-
if (magick_path := shutil.which("magick")) is None:
95+
# Try 'magick' first (ImageMagick 7.x), fall back to 'convert' (6.x)
96+
if (magick_path := shutil.which("magick")) is None and (
97+
magick_path := shutil.which("convert")
98+
) is None:
9699
pytest.fail(
97-
"ImageMagick 'magick' command not found - cannot run "
98-
"multi-format test"
100+
"ImageMagick command not found - cannot run multi-format test"
99101
)
100102

101103
image_dir = tmp_path_factory.mktemp("images")

0 commit comments

Comments
 (0)