Skip to content

Commit dbd7a3d

Browse files
anna-singleton-resolveranna-singleton-resolver
authored andcommitted
fix: support 'convert' as well as 'magick' style imagemagick cmds (#86)
* fix: support 'convert' as well as 'magick' style imagemagick cmds for tests * style: lint --------- Co-authored-by: Anna Singleton <anna.singleton@kroll.com> Co-authored-by: anna-singleton-resolver <anna.singleton@resolver.com>
1 parent 0e612c7 commit dbd7a3d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/functional/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ def valid_formatted_image(
9292
tmp_path_factory: pytest.TempPathFactory,
9393
) -> bytes:
9494
image_format = request.param
95-
# Try 'magick' first (ImageMagick 7.x), fall back to 'convert' (6.x)
9695
if (magick_path := shutil.which("magick")) is None and (
9796
magick_path := shutil.which("convert")
9897
) is None:
9998
pytest.fail(
100-
"ImageMagick command not found - cannot run multi-format test"
99+
"ImageMagick 'magick' or 'convert' command not found - cannot "
100+
"run multi-format test"
101101
)
102102

103103
image_dir = tmp_path_factory.mktemp("images")
@@ -121,9 +121,9 @@ def valid_formatted_image(
121121

122122
image_path = image_dir / f"test_image.{image_format}"
123123
if not image_path.exists():
124-
cmd = f'magick "{base_image_path}" "{image_path}"'
124+
cmd = [magick_path, str(base_image_path), str(image_path)]
125125
_ = subprocess.run( # noqa: S603 - false positive :(
126-
[magick_path, str(base_image_path), str(image_path)],
126+
cmd,
127127
check=True,
128128
shell=False,
129129
)

0 commit comments

Comments
 (0)