[Git][reproducible-builds/diffoscope][master] Add a versioned dependency for at least version 5.4.5 for the xz tests; they...

Chris Lamb (@lamby) gitlab at salsa.debian.org
Mon May 20 12:44:58 UTC 2024



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
17c061e7 by Chris Lamb at 2024-05-20T13:43:23+01:00
Add a versioned dependency for at least version 5.4.5 for the xz tests; they fail under (at least xz 5.2.8). (Closes: #374)

- - - - -


1 changed file:

- tests/comparators/test_xz.py


Changes:

=====================================
tests/comparators/test_xz.py
=====================================
@@ -18,6 +18,7 @@
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
 import shutil
+import subprocess
 import pytest
 
 from diffoscope.comparators.xz import XzFile
@@ -25,7 +26,7 @@ from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
 from ..utils.data import load_fixture, assert_diff
-from ..utils.tools import skip_unless_tools_exist
+from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
 xz1 = load_fixture("test1.xz")
@@ -34,6 +35,14 @@ xz3 = load_fixture("test3.xz")
 xz4 = load_fixture("test4.xz")
 
 
+def xz_version():
+    try:
+        out = subprocess.check_output(["xz", "--version"])
+    except subprocess.CalledProcessError as e:
+        out = e.output
+    return out.decode("UTF-8").split()[3].strip()
+
+
 def test_identification(xz1):
     assert isinstance(xz1, XzFile)
 
@@ -83,6 +92,7 @@ def differences_verbose(xz3, xz4):
 
 
 @skip_unless_tools_exist("xz")
+ at skip_unless_tool_is_at_least("xz", xz_version, "5.4.5")
 def test_content_source_verbose(differences_verbose):
     assert differences_verbose[0].source1 == "xz --list"
     assert differences_verbose[0].source2 == "xz --list"



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/17c061e767e612540dd0227c3fd1f9cab460a78f

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/17c061e767e612540dd0227c3fd1f9cab460a78f
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/20240520/f2ca1818/attachment.htm>


More information about the rb-commits mailing list