Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package diffoscope for openSUSE:Factory 
checked in at 2022-06-03 14:16:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/diffoscope (Old)
 and      /work/SRC/openSUSE:Factory/.diffoscope.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "diffoscope"

Fri Jun  3 14:16:55 2022 rev:34 rq:980580 version:214

Changes:
--------
--- /work/SRC/openSUSE:Factory/diffoscope/diffoscope.changes    2022-05-09 
18:44:18.964222436 +0200
+++ /work/SRC/openSUSE:Factory/.diffoscope.new.1548/diffoscope.changes  
2022-06-03 14:17:03.501347049 +0200
@@ -1,0 +2,22 @@
+Fri May 27 06:33:01 UTC 2022 - Sebastian Wagner <sebix+novell....@sebix.at>
+
+- update to version 214:
+ - Support both python-argcomplete 1.x and 2.x.
+ - Add external tool on GNU Guix for xb-tool.
+ - Use assert_diff in test_zip over get_data and separate assert.
+
+-------------------------------------------------------------------
+Sun May 22 10:16:02 UTC 2022 - Sebastian Wagner <sebix+novell....@sebix.at>
+
+- update to version 213:
+ - Don't mask differences in .zip/.jar central directory extra fields.
+ - Don't show a binary comparison of .zip/.jar files if we have at least
+   one observed nested difference.
+ - Use assert_diff in test_zip over get_data and separate assert.
+- update to version 212:
+ - Add support for extracting vmlinuz/vmlinux Linux kernel images.
+   (Closes: reproducible-builds/diffoscope#304)
+ - Some Python .pyc files report as "data", so support ".pyc" as a
+   fallback extension.
+
+-------------------------------------------------------------------
@@ -10 +32 @@
-- - update to version 210:
+- update to version 210:
@@ -13,3 +34,0 @@
-- update to version 209:
- - Update R test fixture for R 4.2.x series. (Closes: #1008446)
- - Update minimum version of Black to prevent test failure on Ubuntu jammy.
@@ -20 +39 @@
-- - update to version 209:
+- update to version 209:
@@ -23,5 +41,0 @@
-- update to version 208:
- - Add graceful handling for UNIX sockets and named pipes.
-   (Closes: reproducible-builds/diffoscope#292)
- - Remove a superfluous log message and reformatt comment lines.
- - Reformat various files to satisfy current version of Black.
@@ -32 +46 @@
-- - update to version 208:
+- update to version 208:
@@ -37,4 +50,0 @@
-- update to version 207:
- - Fix a gnarly regression when comparing directories against non-directories.
-   (Closes: reproducible-builds/diffoscope#292)
- - Use our assert_diff utility where we can within test_directory.py
@@ -45 +55 @@
-- - update to version 207:
+- update to version 207:
@@ -49,6 +58,0 @@
-- update to version 206:
- - Also allow "Unicode text, UTF-8 text" as well as "UTF-8 Unicode text" to
-   match for .buildinfo files too.
- - Add a test for recent file(1) issue regarding .changes files.
-   (Re: reproducible-builds/diffoscope#291)
- - Drop "_PATH" suffix from some module-level globals that are not paths.
@@ -59 +63 @@
-- - update to version 206:
+- update to version 206:
@@ -83 +87 @@
-- - update to version 204:
+- update to version 204:
@@ -93,5 +96,0 @@
-- update to version 203:
- - Improve documentation for --timeout due to a few misconceptions.
-   Add an allowed-to-fail test regarding a regression in directory handling.
- - Tidy control flow in Difference._reverse_self a little.
- - Fix diffing CBFS names that contain spaces.
@@ -102 +101 @@
-- - update to version 203:
+- update to version 203:
@@ -107,17 +105,0 @@
-- update to version 202:
- - Don't fail if comparing a nonexistent file with a .pyc file (and add test).
-   (Closes: #1004312)
- - Drop a reference in the manual page which claims the ability to compare
-   non-existent files on the command-line. This has not been possible since
-   version 32 which was released in September 2015. (Closes: #1004182)
- - Add experimental support for incremental output support with a timeout.
-   Passing, for example, --timeout=60 will mean that diffoscope will not
-   recurse into any sub-archives after 60 seconds total execution time has
-   elapsed and mark the diff as being incomplete. (Note that this is not a
-   fixed/strict timeout due to implementation issues.)
-   (Closes: reproducible-builds/diffoscope#301)
- - Don't return with an exit code of 0 if we encounter device file such as
-   /dev/stdin with human-readable metadata that matches literal, non-device,
-   file contents. (Closes: #1004198)
- - Correct a "recompile" typo.
- - Fix/update whitespace for Black 21.12.
@@ -128 +110 @@
-- - update to version 202:
+- update to version 202:
@@ -145,6 +126,0 @@
-- update to version 201:
- - If the debian.deb822 module raises any exception on import, re-raise it as
-   an ImportError instead. This should fix diffoscope on some Fedora systems.
-   Thanks to Mattia Rizzolo for suggesting this particular solution.
-   (Closes: reproducible-builds/diffoscope#300)
- - Fix json detection with file-5.41-3.fc36.x86_64.
@@ -155 +131 @@
-- - update to version 201:
+- update to version 201:
@@ -161,8 +136,0 @@
-- update to version 200:
- - Even if a Sphinx .inv inventory file is labelled "The remainder of this
-   file is compressed using zlib", it might not actually be. In this case,
-   don't traceback, and simply return the original content.
-   (Closes: reproducible-builds/diffoscope#299)
- - Update "X has been modified after NT_GNU_BUILD_ID has been applied" message
-   to, for instance, not duplicating the full filename in the primary
-   diffoscope's output.
@@ -173 +141 @@
-- - update to version 200:
+- update to version 200:
@@ -181,4 +148,0 @@
-- update to version 199:
- - Support both variants of "odt2txt", including the one provided by unoconv.
-   (Closes: reproducible-builds/diffoscope#298)
- - Add external tool reference on Arch Linux for xb-tool.
@@ -189 +153 @@
-- - update to version 199:
+- update to version 199:
@@ -193,7 +156,0 @@
-- update to version 198:
- - Support showing "Ordering differences only" within .dsc field values.
-   (Closes: #1002002, reproducible-builds/diffoscope#297)
- - Support OCaml versions 4.11, 4.12 and 4.13. (Closes: #1002678)
- - Add support for XMLb files. (Closes: reproducible-builds/diffoscope#295)
- - Also add, for example, /usr/lib/x86_64-linux-gnu to our internal PATH.
- - Also recognize "GnuCash file" files as XML.
@@ -204 +161 @@
-- - update to version 198:
+- update to version 198:
@@ -211,5 +167,0 @@
-- update to version 197:
- - Drop unnecessary has_same_content_as logging calls.
- - Ignore the new "binary-with-bad-dynamic-table" Lintian tag.
- - Support pgpdump 0.34 in the tests. Thanks to Michael Weiss
-   <dev.prim...@gmail.com> for reporting and testing the fix.
@@ -220 +172 @@
-- - update to version 197:
+- update to version 197:
@@ -225,4 +176,0 @@
-- update to version 196:
- - Add a comment/annotation when the GNU_BUILD_ID field has been modified.
- - Fix the "Black" version detection.
- - Replace "token" with anonymous variable "x" in order to remove extra lines.
@@ -233 +181 @@
-- - update to version 196:
+- update to version 196:
@@ -237,3 +184,0 @@
-- update to version 195:
- - Don't use the runtime platform's native endianness when unpacking .pyc
-   files to fix test failures on big-endian machines.
@@ -244 +189 @@
-- - update to version 195:
+- update to version 195:
@@ -254,17 +198,0 @@
-- update to version 193:
- - Don't duplicate file lists at each directory level.
-   (Closes: #989192, reproducible-builds/diffoscope#263)
- - When pretty-printing JSON, mark the difference as such, additionally
-   avoiding including the full path.
-   (Closes: reproducible-builds/diffoscope#205)
- - Codebase improvements:
-   - Update a bunch of %-style string interpolations into f-strings or
-     str.format.
-   - Import itertools top-level directly.
-   - Drop some unused imports.
-   - Use isinstance(...) over type(...) ==
-   - Avoid aliasing variables if we aren't going to use them.
- - Fix missing diff output on large diffs.
- - Ignore a Python warning coming from a dependent library (triggered by
-   supporting Python 3.10)
- - Document that support both Python 3.9 and 3.10.
@@ -275 +203 @@
-- - update to version 193:
+- update to version 193:

Old:
----
  diffoscope-211.tar.bz2
  diffoscope-211.tar.bz2.asc

New:
----
  diffoscope-214.tar.bz2
  diffoscope-214.tar.bz2.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ diffoscope.spec ++++++
--- /var/tmp/diff_new_pack.6duzM5/_old  2022-06-03 14:17:04.917348888 +0200
+++ /var/tmp/diff_new_pack.6duzM5/_new  2022-06-03 14:17:04.921348894 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           diffoscope
-Version:        211
+Version:        214
 Release:        0
 Summary:        In-depth comparison of files, archives, and directories
 License:        GPL-3.0-or-later

++++++ diffoscope-211.tar.bz2 -> diffoscope-214.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/MANIFEST.in 
new/diffoscope-214/MANIFEST.in
--- old/diffoscope-211/MANIFEST.in      2022-04-28 17:20:26.000000000 +0200
+++ new/diffoscope-214/MANIFEST.in      2022-05-27 07:53:07.000000000 +0200
@@ -2,4 +2,5 @@
 include README.rst
 include CONTRIBUTING.md
 include pyproject.toml
+graft scripts
 graft tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/debian/changelog 
new/diffoscope-214/debian/changelog
--- old/diffoscope-211/debian/changelog 2022-04-28 17:20:26.000000000 +0200
+++ new/diffoscope-214/debian/changelog 2022-05-27 07:53:07.000000000 +0200
@@ -1,3 +1,31 @@
+diffoscope (214) unstable; urgency=medium
+
+  [ Chris Lamb ]
+  * Support both python-argcomplete 1.x and 2.x.
+
+  [ Vagrant Cascadian ]
+  * Add external tool on GNU Guix for xb-tool.
+
+ -- Chris Lamb <la...@debian.org>  Fri, 27 May 2022 06:53:04 +0100
+
+diffoscope (213) unstable; urgency=medium
+
+  * Don't mask differences in .zip/.jar central directory extra fields.
+  * Don't show a binary comparison of .zip/.jar files if we have at least
+    one observed nested difference.
+  * Use assert_diff in test_zip over get_data and separate assert.
+
+ -- Chris Lamb <la...@debian.org>  Fri, 20 May 2022 08:15:29 -0700
+
+diffoscope (212) unstable; urgency=medium
+
+  * Add support for extracting vmlinuz/vmlinux Linux kernel images.
+    (Closes: reproducible-builds/diffoscope#304)
+  * Some Python .pyc files report as "data", so support ".pyc" as a
+    fallback extension.
+
+ -- Chris Lamb <la...@debian.org>  Fri, 13 May 2022 08:19:57 -0700
+
 diffoscope (211) unstable; urgency=medium
 
   [ Mattia Rizzolo ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/debian/rules 
new/diffoscope-214/debian/rules
--- old/diffoscope-211/debian/rules     2022-04-28 17:20:26.000000000 +0200
+++ new/diffoscope-214/debian/rules     2022-05-27 07:53:07.000000000 +0200
@@ -38,7 +38,7 @@
        $(MAKE) -C doc $*.1
 
 debian/diffoscope-minimal.bash-completion:
-       register-python-argcomplete3 diffoscope > $@
+       register-python-argcomplete diffoscope || register-python-argcomplete3 
diffoscope > $@
 
 execute_after_dh_auto_build: debian/diffoscope-minimal.bash-completion
        dh_auto_build -O--buildsystem=makefile -Ddoc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/diffoscope/__init__.py 
new/diffoscope-214/diffoscope/__init__.py
--- old/diffoscope-211/diffoscope/__init__.py   2022-04-28 17:20:26.000000000 
+0200
+++ new/diffoscope-214/diffoscope/__init__.py   2022-05-27 07:53:07.000000000 
+0200
@@ -17,4 +17,4 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
-VERSION = "211"
+VERSION = "214"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/diffoscope/comparators/__init__.py 
new/diffoscope-214/diffoscope/comparators/__init__.py
--- old/diffoscope-211/diffoscope/comparators/__init__.py       2022-04-28 
17:20:26.000000000 +0200
+++ new/diffoscope-214/diffoscope/comparators/__init__.py       2022-05-27 
07:53:07.000000000 +0200
@@ -118,6 +118,7 @@
         ("xsb.XsbFile",),
         ("berkeley_db.BerkeleyDBFile",),
         ("zst.ZstFile",),
+        ("vmlinuz.VmlinuzFile",),
     )
 
     _singleton = {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/diffoscope/comparators/python.py 
new/diffoscope-214/diffoscope/comparators/python.py
--- old/diffoscope-211/diffoscope/comparators/python.py 2022-04-28 
17:20:26.000000000 +0200
+++ new/diffoscope-214/diffoscope/comparators/python.py 2022-05-27 
07:53:07.000000000 +0200
@@ -37,6 +37,7 @@
 class PycFile(File):
     DESCRIPTION = "Python .pyc files"
     FILE_TYPE_RE = re.compile(r"^python .*byte-compiled$")
+    FALLBACK_FILE_EXTENSION_SUFFIX = {".pyc"}
 
     def compare_details(self, other, source=None):
         if isinstance(other, MissingFile):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/diffoscope/comparators/vmlinuz.py 
new/diffoscope-214/diffoscope/comparators/vmlinuz.py
--- old/diffoscope-211/diffoscope/comparators/vmlinuz.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/diffoscope-214/diffoscope/comparators/vmlinuz.py        2022-05-27 
07:53:07.000000000 +0200
@@ -0,0 +1,65 @@
+#
+# diffoscope: in-depth comparison of files, archives, and directories
+#
+# Copyright ?? 2022 Chris Lamb <la...@debian.org>
+#
+# diffoscope is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# diffoscope is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
+
+import logging
+import os.path
+import pathlib
+import re
+import subprocess
+
+from diffoscope.tools import tool_required
+
+from .utils.file import File
+from .utils.archive import Archive
+
+logger = logging.getLogger(__name__)
+
+
+class VmlinuzContainer(Archive):
+    def open_archive(self):
+        return self
+
+    def close_archive(self):
+        pass
+
+    def get_member_names(self):
+        return [self.get_compressed_content_name(".vmlinuz")]
+
+    @tool_required("readelf")
+    def extract(self, member_name, dest_dir):
+        dest_path = os.path.join(dest_dir, member_name)
+        logger.debug("extracting vmlinuz to %s", dest_path)
+
+        # Locate extract-vmlinux script
+        script = pathlib.Path(__file__).parent.parent.parent.joinpath(
+            "scripts", "extract-vmlinux"
+        )
+        with open(dest_path, "wb") as f:
+            subprocess.check_call(
+                [script, self.source.path],
+                stdout=f,
+                stderr=None,
+            )
+
+        return dest_path
+
+
+class VmlinuzFile(File):
+    DESCRIPTION = "Linux kernel images"
+    CONTAINER_CLASSES = [VmlinuzContainer]
+    FILE_TYPE_RE = re.compile(r"^Linux kernel\b")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/diffoscope/comparators/zip.py 
new/diffoscope-214/diffoscope/comparators/zip.py
--- old/diffoscope-211/diffoscope/comparators/zip.py    2022-04-28 
17:20:26.000000000 +0200
+++ new/diffoscope-214/diffoscope/comparators/zip.py    2022-05-27 
07:53:07.000000000 +0200
@@ -122,11 +122,34 @@
     Run all our zipinfo variants.
     """
 
-    for x in (Zipinfo, ZipinfoVerbose, BsdtarVerbose):
-        result = Difference.from_operation(x, file.path, other.path)
-        # We only return the 'best' one
-        if result is not None:
-            return [result]
+    # We need to run both "zipinfo" and "zipinfo -v" in all code paths, so just
+    # run them both first.
+    zipinfo = Difference.from_operation(Zipinfo, file.path, other.path)
+    verbose = Difference.from_operation(ZipinfoVerbose, file.path, other.path)
+
+    # First try and prefer "zipinfo"...
+    if zipinfo is not None:
+        # ... but if "zipinfo -v" indicates we have differences in .zip
+        # directory "extra fields", add a comment and prefer that output.
+        if re.search(
+            r"[-+]  The central-directory extra field contains:",
+            verbose.unified_diff,
+        ):
+            verbose.add_comment(
+                "Differences in extra fields detected; using output from 
zipinfo -v"
+            )
+            return [verbose]
+
+        return [zipinfo]
+
+    # If none of this was detected, fallback to "zipinfo -v"...
+    if verbose is not None:
+        return [verbose]
+
+    # ... and, finally, "bsdtar -tvz"
+    bsdtar = Difference.from_operation(BsdtarVerbose, file.path, other.path)
+    if bsdtar is not None:
+        return [bsdtar]
 
     return []
 
@@ -196,11 +219,11 @@
         if x is None:
             return None
 
-        # If we have two or more differences, then we have observed differences
-        # within a nested file. If not, there is likely some difference in
-        # the metadata that zipinfo cannot discover, so we manually fallback to
-        # a binary diff.
-        if len(x.details) >= 2:
+        # If we have at least one differences, then we have observed
+        # differences within a nested file. If not, there is likely some
+        # difference in the metadata that zipinfo cannot discover, so we
+        # manually fallback to a binary diff.
+        if len(x.details) >= 1:
             return x
 
         x.add_comment(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/diffoscope/external_tools.py 
new/diffoscope-214/diffoscope/external_tools.py
--- old/diffoscope-211/diffoscope/external_tools.py     2022-04-28 
17:20:26.000000000 +0200
+++ new/diffoscope-214/diffoscope/external_tools.py     2022-05-27 
07:53:07.000000000 +0200
@@ -238,7 +238,7 @@
     "zipnote": {"debian": "zip", "guix": "zip"},
     "procyon": {"debian": "procyon-decompiler"},
     "dumpxsb": {"debian": "xmlbeans"},
-    "xb-tool": {"debian": "libxmlb-dev", "arch": "libxmlb"},
+    "xb-tool": {"debian": "libxmlb-dev", "arch": "libxmlb", "guix": "libxmlb"},
     "zstd": {"debian": "zstd", "guix": "zstd"},
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/scripts/extract-vmlinux 
new/diffoscope-214/scripts/extract-vmlinux
--- old/diffoscope-211/scripts/extract-vmlinux  1970-01-01 01:00:00.000000000 
+0100
+++ new/diffoscope-214/scripts/extract-vmlinux  2022-05-27 07:53:07.000000000 
+0200
@@ -0,0 +1,64 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+# ----------------------------------------------------------------------
+# extract-vmlinux - Extract uncompressed vmlinux from a kernel image
+#
+# Inspired from extract-ikconfig
+# (c) 2009,2010 Dick Streefland <d...@streefland.net>
+#
+# (c) 2011      Corentin Chary <corentin.ch...@gmail.com>
+#
+# ----------------------------------------------------------------------
+
+check_vmlinux()
+{
+       # Use readelf to check if it's a valid ELF
+       # TODO: find a better to way to check that it's really vmlinux
+       #       and not just an elf
+       readelf -h $1 > /dev/null 2>&1 || return 1
+
+       cat $1
+       exit 0
+}
+
+try_decompress()
+{
+       # The obscure use of the "tr" filter is to work around older versions of
+       # "grep" that report the byte offset of the line instead of the pattern.
+
+       # Try to find the header ($1) and decompress from here
+       for     pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
+       do
+               pos=${pos%%:*}
+               tail -c+$pos "$img" | $3 > $tmp 2> /dev/null
+               check_vmlinux $tmp
+       done
+}
+
+# Check invocation:
+me=${0##*/}
+img=$1
+if     [ $# -ne 1 -o ! -s "$img" ]
+then
+       echo "Usage: $me <kernel-image>" >&2
+       exit 2
+fi
+
+# Prepare temp files:
+tmp=$(mktemp /tmp/vmlinux-XXX)
+trap "rm -f $tmp" 0
+
+# That didn't work, so retry after decompression.
+try_decompress '\037\213\010' xy    gunzip
+try_decompress '\3757zXZ\000' abcde unxz
+try_decompress 'BZh'          xy    bunzip2
+try_decompress '\135\0\0\0'   xxx   unlzma
+try_decompress '\211\114\132' xy    'lzop -d'
+try_decompress '\002!L\030'   xxx   'lz4 -d'
+try_decompress '(\265/\375'   xxx   unzstd
+
+# Finally check for uncompressed images or objects:
+check_vmlinux $img
+
+# Bail out:
+echo "$me: Cannot find vmlinux." >&2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-211/tests/comparators/test_zip.py 
new/diffoscope-214/tests/comparators/test_zip.py
--- old/diffoscope-211/tests/comparators/test_zip.py    2022-04-28 
17:20:26.000000000 +0200
+++ new/diffoscope-214/tests/comparators/test_zip.py    2022-05-27 
07:53:07.000000000 +0200
@@ -21,7 +21,7 @@
 
 from diffoscope.comparators.zip import ZipFile, MozillaZipFile, JmodJavaModule
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff
 from ..utils.tools import skip_unless_tools_exist
 from ..utils.nonexisting import assert_non_existing
 
@@ -60,22 +60,19 @@
 
 @skip_unless_tools_exist("zipinfo")
 def test_metadata(differences):
-    expected_diff = get_data("zip_zipinfo_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "zip_zipinfo_expected_diff")
 
 
 @skip_unless_tools_exist("zipinfo")
 def test_compressed_files(differences):
     assert differences[1].source1 == "dir/text"
     assert differences[1].source2 == "dir/text"
-    expected_diff = get_data("text_ascii_expected_diff")
-    assert differences[1].unified_diff == expected_diff
+    assert_diff(differences[1], "text_ascii_expected_diff")
 
 
 @skip_unless_tools_exist("zipinfo", "bsdtar")
 def test_extra_fields(differences2):
-    expected_diff = get_data("zip_bsdtar_expected_diff")
-    assert differences2[0].unified_diff == expected_diff
+    assert_diff(differences2[0], "zip_bsdtar_expected_diff")
 
 
 @skip_unless_tools_exist("zipinfo")
@@ -99,16 +96,14 @@
 
 @skip_unless_tools_exist("zipinfo")
 def test_mozzip_metadata(mozzip_differences, mozzip1, mozzip2):
-    expected_diff = get_data("mozzip_zipinfo_expected_diff")
-    assert mozzip_differences[0].unified_diff == expected_diff
+    assert_diff(mozzip_differences[0], "mozzip_zipinfo_expected_diff")
 
 
 @skip_unless_tools_exist("zipinfo")
 def test_mozzip_compressed_files(mozzip_differences):
     assert mozzip_differences[-1].source1 == "dir/text"
     assert mozzip_differences[-1].source2 == "dir/text"
-    expected_diff = get_data("text_ascii_expected_diff")
-    assert mozzip_differences[-1].unified_diff == expected_diff
+    assert_diff(mozzip_differences[-1], "text_ascii_expected_diff")
 
 
 @skip_unless_tools_exist("zipinfo")
@@ -132,8 +127,7 @@
 
 @skip_unless_tools_exist("zipinfo")
 def test_jmod_metadata(jmod_differences, jmod1, jmod2):
-    expected_diff = get_data("jmod_zipinfo_expected_diff")
-    assert jmod_differences[0].unified_diff == expected_diff
+    assert_diff(jmod_differences[0], "jmod_zipinfo_expected_diff")
 
 
 def test_encrypted(encrypted_zip1, encrypted_zip2):
@@ -148,5 +142,4 @@
 
 @skip_unless_tools_exist("zipnote")
 def test_commented(comment_differences):
-    expected_diff = get_data("comment_zipinfo_expected_diff")
-    assert comment_differences[1].unified_diff == expected_diff
+    assert_diff(comment_differences[1], "comment_zipinfo_expected_diff")

Reply via email to