[Git][reproducible-builds/diffoscope][master] 2 commits: Factor out version detection in test_jpeg_image. (Re: reproducible-builds/diffoscope#384)

Chris Lamb (@lamby) gitlab at salsa.debian.org
Mon Jul 22 13:27:43 UTC 2024



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
037bdcbb by Chris Lamb at 2024-07-22T14:26:33+01:00
Factor out version detection in test_jpeg_image. (Re: reproducible-builds/diffoscope#384)

- - - - -
bbcf367c by Chris Lamb at 2024-07-22T14:26:41+01:00
Ensure that 'convert' is from Imagemagick 6.x; we will need to update a few things with IM7. (Closes: reproducible-builds/diffoscope#384)

- - - - -


1 changed file:

- tests/comparators/test_jpeg_image.py


Changes:

=====================================
tests/comparators/test_jpeg_image.py
=====================================
@@ -33,8 +33,8 @@ image1_meta = load_fixture("test1_meta.jpg")
 image2_meta = load_fixture("test2_meta.jpg")
 
 
-def identify_version():
-    out = subprocess.check_output(["identify", "-version"]).decode("utf-8")
+def imagemagick_version(command):
+    out = subprocess.check_output([command, "-version"]).decode("utf-8")
     # First line is expected to look like
     # "Version: ImageMagick 6.9.6-6 Q16 x86_64 20161125 ..."
     if not out.startswith("Version: ImageMagick "):
@@ -75,11 +75,16 @@ def differences_meta(image1_meta, image2_meta):
 
 
 @skip_unless_tools_exist("img2txt", "identify")
- at skip_unless_tool_is_between("identify", identify_version, "6.9.6", "7.0.0")
+ at skip_unless_tool_is_between(
+    "identify", lambda: imagemagick_version("identify"), "6.9.6", "7.0.0"
+)
 def test_diff_meta(differences_meta):
     assert_diff(differences_meta[-1], "jpeg_image_meta_expected_diff")
 
 
+ at skip_unless_tool_is_between(
+    "convert", lambda: imagemagick_version("convert"), "6.9.6", "7.0.0"
+)
 @skip_unless_tools_exist("img2txt", "convert", "identify")
 def test_has_visuals(monkeypatch, image1, image2):
     monkeypatch.setattr(Config(), "compute_visual_diffs", True)



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/82bbacbf0060a1b89cde5b5c950f754935757605...bbcf367cca97eac25129ad861c628a3203a3500e

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/82bbacbf0060a1b89cde5b5c950f754935757605...bbcf367cca97eac25129ad861c628a3203a3500e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240722/42f4207e/attachment.htm>


More information about the rb-commits mailing list