[diffoscope] 01/01: tests: adds skip on tests which depends on xz

Juliana Oliveira jwnx-guest at moszumanska.debian.org
Mon Dec 25 22:49:02 CET 2017


This is an automated email from the git hooks/post-receive script.

jwnx-guest pushed a commit to branch jwnx_fix_xz_utils_dep
in repository diffoscope.

commit 97c314bca5665ad0034776a34a4c38969912626e
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date:   Tue Dec 26 00:27:50 2017 +0300

    tests: adds skip on tests which depends on xz
    
    Some tests ran without checking xz existence.
    /skip_unless_tool_exist/ was added to tests that failed if xz is
    not present.
    
    Signed-off-by: Juliana Oliveira <juliana.orod at gmail.com>
---
 tests/comparators/test_containers.py | 3 +++
 tests/comparators/test_deb.py        | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tests/comparators/test_containers.py b/tests/comparators/test_containers.py
index ac6d55d..0f8ee86 100644
--- a/tests/comparators/test_containers.py
+++ b/tests/comparators/test_containers.py
@@ -22,6 +22,7 @@ import pytest
 import itertools
 
 from ..utils.data import load_fixture, get_data
+from ..utils.tools import skip_unless_tools_exist
 
 gzip1 = load_fixture('containers/a.tar.gz')
 gzip2 = load_fixture('containers/b.tar.gz')
@@ -51,6 +52,7 @@ def expected_type_diff(ext1, ext2):
     return "@@ -1 +1 @@\n-%sFile\n+%sFile\n" % (ext1.capitalize(), ext2.capitalize())
 
 # Compares same content files, but with different extensions
+ at skip_unless_tools_exist('xz')
 def test_equal(set1):
     for x, y in itertools.product(TYPES, TYPES):
         diff = set1[x].compare(set1[y])
@@ -62,6 +64,7 @@ def test_equal(set1):
             assert differences[1].unified_diff == expected_type_diff(x, y)
 
 # Compares different content files with different extensions
+ at skip_unless_tools_exist('xz')
 def test_different(set1, set2):
     for x, y in itertools.product(TYPES, TYPES):
         expected_diff = get_data('containers/different_files_expected_diff')
diff --git a/tests/comparators/test_deb.py b/tests/comparators/test_deb.py
index 0746bc2..6788c72 100644
--- a/tests/comparators/test_deb.py
+++ b/tests/comparators/test_deb.py
@@ -27,6 +27,7 @@ from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.utils.specialize import specialize
 
+from ..utils.tools import skip_unless_tools_exist
 from ..utils.data import load_fixture, get_data
 
 
@@ -129,6 +130,8 @@ def test_compare_non_existing(monkeypatch, deb1):
 bug881937_deb1 = load_fixture('bug881937_1.deb')
 bug881937_deb2 = load_fixture('bug881937_2.deb')
 
+
+ at skip_unless_tools_exist('xz')
 def test_compare_different_compression(bug881937_deb1, bug881937_deb2):
     difference = bug881937_deb1.compare(bug881937_deb2)
     assert difference.details[1].source1 == 'control.tar.gz'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list