[diffoscope] 01/01: Rename skip_unless_tool_exists -> skip_unless_tools_exist and fix logic.
Chris Lamb
chris at chris-lamb.co.uk
Sun Aug 21 19:41:39 CEST 2016
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit 1065b642dd69c7e1c0a680325e2ef7e8dc01508f
Author: Chris Lamb <lamby at debian.org>
Date: Sun Aug 21 18:41:34 2016 +0100
Rename skip_unless_tool_exists -> skip_unless_tools_exist and fix logic.
I misread the inverted logic of "skipIf(not tool_exists(x) or not tool_exists(y))".
Signed-off-by: Chris Lamb <lamby at debian.org>
---
tests/comparators/test_binary.py | 10 +++++-----
tests/comparators/test_bzip2.py | 10 +++++-----
tests/comparators/test_cbfs.py | 14 +++++++-------
tests/comparators/test_cpio.py | 10 +++++-----
tests/comparators/test_dex.py | 10 +++-------
tests/comparators/test_elf.py | 14 +++++++-------
tests/comparators/test_epub.py | 6 +++---
tests/comparators/test_fonts.py | 6 +++---
tests/comparators/test_fsimage.py | 8 ++++----
tests/comparators/test_gettext.py | 8 ++++----
tests/comparators/test_haskell.py | 6 +++---
tests/comparators/test_icc.py | 6 +++---
tests/comparators/test_image.py | 6 +++---
tests/comparators/test_iso9660.py | 12 ++++++------
tests/comparators/test_java.py | 6 +++---
tests/comparators/test_macho.py | 6 +++---
tests/comparators/test_mono.py | 6 +++---
tests/comparators/test_pdf.py | 8 ++++----
tests/comparators/test_png.py | 6 +++---
tests/comparators/test_ppu.py | 8 ++++----
tests/comparators/test_ps.py | 8 ++++----
tests/comparators/test_rlib.py | 4 ++--
tests/comparators/test_rpm.py | 10 +++++-----
tests/comparators/test_sqlite.py | 6 +++---
tests/comparators/test_squashfs.py | 10 +++++-----
tests/comparators/test_utils.py | 12 ++++++------
tests/comparators/test_xz.py | 10 +++++-----
tests/comparators/test_zip.py | 14 +++++++-------
tests/comparators/utils.py | 6 +++---
29 files changed, 121 insertions(+), 125 deletions(-)
diff --git a/tests/comparators/test_binary.py b/tests/comparators/test_binary.py
index 5cc1160..5b9a7c1 100644
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -27,7 +27,7 @@ from diffoscope.exc import RequiredToolNotFound
from diffoscope.difference import Difference
from diffoscope.comparators.binary import File, FilesystemFile, NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
TEST_FILE1_PATH = data('binary1')
TEST_FILE2_PATH = data('binary2')
@@ -64,7 +64,7 @@ def test_no_differences_with_xxd(binary1):
difference = binary1.compare_bytes(binary1)
assert difference is None
- at skip_unless_tool_exists('xxd')
+ at skip_unless_tools_exist('xxd')
def test_compare_with_xxd(binary1, binary2):
difference = binary1.compare_bytes(binary2)
expected_diff = open(data('binary_expected_diff')).read()
@@ -97,7 +97,7 @@ def test_with_compare_details():
difference = MockFile(TEST_FILE1_PATH).compare(MockFile(TEST_FILE2_PATH), source='source')
assert difference.details[0] == d
- at skip_unless_tool_exists('xxd')
+ at skip_unless_tools_exist('xxd')
def test_with_compare_details_and_fallback():
class MockFile(FilesystemFile):
def compare_details(self, other, source=None):
@@ -114,7 +114,7 @@ def test_with_compare_details_and_no_actual_differences():
difference = MockFile(TEST_FILE1_PATH).compare(MockFile(TEST_FILE1_PATH))
assert difference is None
- at skip_unless_tool_exists('xxd')
+ at skip_unless_tools_exist('xxd')
def test_with_compare_details_and_failed_process():
output = 'Free Jeremy Hammond'
class MockFile(FilesystemFile):
@@ -127,7 +127,7 @@ def test_with_compare_details_and_failed_process():
assert '42' in difference.comment
assert difference.unified_diff == expected_diff
- at skip_unless_tool_exists('xxd')
+ at skip_unless_tools_exist('xxd')
def test_with_compare_details_and_tool_not_found(monkeypatch):
monkeypatch.setattr('diffoscope.exc.RequiredToolNotFound.get_package', lambda _: 'some-package')
class MockFile(FilesystemFile):
diff --git a/tests/comparators/test_bzip2.py b/tests/comparators/test_bzip2.py
index 75356b4..293bfa2 100644
--- a/tests/comparators/test_bzip2.py
+++ b/tests/comparators/test_bzip2.py
@@ -24,7 +24,7 @@ from diffoscope.comparators import specialize
from diffoscope.comparators.bzip2 import Bzip2File
from diffoscope.comparators.binary import FilesystemFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
@@ -45,12 +45,12 @@ def test_no_differences(bzip1):
def differences(bzip1, bzip2):
return bzip1.compare(bzip2).details
- at skip_unless_tool_exists('bzip2')
+ at skip_unless_tools_exist('bzip2')
def test_content_source(differences):
assert differences[0].source1 == 'test1'
assert differences[0].source2 == 'test2'
- at skip_unless_tool_exists('bzip2')
+ at skip_unless_tools_exist('bzip2')
def test_content_source_without_extension(tmpdir):
path1 = str(tmpdir.join('test1'))
path2 = str(tmpdir.join('test2'))
@@ -62,11 +62,11 @@ def test_content_source_without_extension(tmpdir):
assert differences[0].source1 == 'test1-content'
assert differences[0].source2 == 'test2-content'
- at skip_unless_tool_exists('bzip2')
+ at skip_unless_tools_exist('bzip2')
def test_content_diff(differences):
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('bzip2')
+ at skip_unless_tools_exist('bzip2')
def test_compare_non_existing(monkeypatch, bzip1):
assert_non_existing(monkeypatch, bzip1)
diff --git a/tests/comparators/test_cbfs.py b/tests/comparators/test_cbfs.py
index 24d676d..b1ea951 100644
--- a/tests/comparators/test_cbfs.py
+++ b/tests/comparators/test_cbfs.py
@@ -26,7 +26,7 @@ from diffoscope.presenters.text import output_text
from diffoscope.comparators.cbfs import CbfsFile
from diffoscope.comparators.binary import FilesystemFile
-from utils import skip_unless_tool_exists, data, assert_non_existing
+from utils import skip_unless_tools_exist, data, assert_non_existing
TEST_FILE1_PATH = data('text_ascii1')
TEST_FILE2_PATH = data('text_ascii2')
@@ -54,15 +54,15 @@ def rom2(tmpdir):
f.write(buf[:-4])
return specialize(FilesystemFile(path))
- at skip_unless_tool_exists('cbfstool')
+ at skip_unless_tools_exist('cbfstool')
def test_identification_using_offset(rom1):
assert isinstance(rom1, CbfsFile)
- at skip_unless_tool_exists('cbfstool')
+ at skip_unless_tools_exist('cbfstool')
def test_identification_without_offset(rom2):
assert isinstance(rom2, CbfsFile)
- at skip_unless_tool_exists('cbfstool')
+ at skip_unless_tools_exist('cbfstool')
def test_no_differences(rom1):
difference = rom1.compare(rom1)
assert difference is None
@@ -73,18 +73,18 @@ def differences(rom1, rom2):
output_text(difference, print_func=print)
return difference.details
- at skip_unless_tool_exists('cbfstool')
+ at skip_unless_tools_exist('cbfstool')
def test_listing(differences):
expected_diff = open(data('cbfs_listing_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('cbfstool')
+ at skip_unless_tools_exist('cbfstool')
def test_content(differences):
assert differences[1].source1 == 'text'
assert differences[1].source2 == 'text'
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[1].unified_diff == expected_diff
- at skip_unless_tool_exists('cbfstool')
+ at skip_unless_tools_exist('cbfstool')
def test_compare_non_existing(monkeypatch, rom1):
assert_non_existing(monkeypatch, rom1)
diff --git a/tests/comparators/test_cpio.py b/tests/comparators/test_cpio.py
index 761533e..9daeb95 100644
--- a/tests/comparators/test_cpio.py
+++ b/tests/comparators/test_cpio.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.cpio import CpioFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
@@ -39,25 +39,25 @@ def test_no_differences(cpio1):
def differences(cpio1, cpio2):
return cpio1.compare(cpio2).details
- at skip_unless_tool_exists('cpio')
+ at skip_unless_tools_exist('cpio')
def test_listing(differences):
expected_diff = open(data('cpio_listing_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('cpio')
+ at skip_unless_tools_exist('cpio')
def test_symlink(differences):
assert differences[1].source1 == 'dir/link'
assert differences[1].comment == 'symlink'
expected_diff = open(data('symlink_expected_diff')).read()
assert differences[1].unified_diff == expected_diff
- at skip_unless_tool_exists('cpio')
+ at skip_unless_tools_exist('cpio')
def test_compressed_files(differences):
assert differences[2].source1 == 'dir/text'
assert differences[2].source2 == 'dir/text'
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[2].unified_diff == expected_diff
- at skip_unless_tool_exists('cpio')
+ at skip_unless_tools_exist('cpio')
def test_compare_non_existing(monkeypatch, cpio1):
assert_non_existing(monkeypatch, cpio1)
diff --git a/tests/comparators/test_dex.py b/tests/comparators/test_dex.py
index 787f7f4..b588362 100644
--- a/tests/comparators/test_dex.py
+++ b/tests/comparators/test_dex.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.dex import DexFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
dex1 = load_fixture(data('test1.dex'))
@@ -40,9 +40,7 @@ def test_no_differences(dex1):
def differences(dex1, dex2):
return dex1.compare(dex2).details
- at skip_unless_tool_exists('enjarify')
- at skip_unless_tool_exists('zipinfo')
- at skip_unless_tool_exists('javap')
+ at skip_unless_tools_exist('enjarify', 'zipinfo', 'javap')
def test_differences(differences):
assert differences[0].source1 == 'test1.jar'
assert differences[0].source2 == 'test2.jar'
@@ -56,9 +54,7 @@ def test_differences(differences):
found_diff = zipinfo.unified_diff + classdiff.details[0].unified_diff
assert expected_diff == found_diff
- at skip_unless_tool_exists('enjarify')
- at skip_unless_tool_exists('zipinfo')
- at skip_unless_tool_exists('javap')
+ at skip_unless_tools_exist('enjarify', 'zipinfo', 'javap')
def test_compare_non_existing(monkeypatch, dex1):
monkeypatch.setattr(Config.general, 'new_file', True)
difference = dex1.compare(NonExistingFile('/nonexisting', dex1))
diff --git a/tests/comparators/test_elf.py b/tests/comparators/test_elf.py
index ee150a1..044317c 100644
--- a/tests/comparators/test_elf.py
+++ b/tests/comparators/test_elf.py
@@ -27,7 +27,7 @@ from diffoscope.comparators.elf import ElfFile, StaticLibFile
from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
from diffoscope.comparators.directory import FilesystemDirectory
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
try:
import diffoscope.comparators.debian # noqa
@@ -49,14 +49,14 @@ def test_obj_no_differences(obj1):
def obj_differences(obj1, obj2):
return obj1.compare(obj2).details
- at skip_unless_tool_exists('readelf')
+ at skip_unless_tools_exist('readelf')
def test_obj_compare_non_existing(monkeypatch, obj1):
monkeypatch.setattr(Config, 'new_file', True)
difference = obj1.compare(NonExistingFile('/nonexisting', obj1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
- at skip_unless_tool_exists('readelf')
+ at skip_unless_tools_exist('readelf')
def test_diff(obj_differences):
assert len(obj_differences) == 1
expected_diff = open(data('elf_obj_expected_diff')).read()
@@ -84,7 +84,7 @@ def test_lib_no_differences(lib1):
def lib_differences(lib1, lib2):
return lib1.compare(lib2).details
- at skip_unless_tool_exists('readelf', 'objdump')
+ at skip_unless_tools_exist('readelf', 'objdump')
def test_lib_differences(lib_differences):
assert len(lib_differences) == 2
assert lib_differences[0].source1 == 'file list'
@@ -94,7 +94,7 @@ def test_lib_differences(lib_differences):
expected_objdump_diff = open(data('elf_lib_objdump_expected_diff')).read()
assert lib_differences[1].unified_diff == expected_objdump_diff
- at skip_unless_tool_exists('readelf', 'objdump')
+ at skip_unless_tools_exist('readelf', 'objdump')
def test_lib_compare_non_existing(monkeypatch, lib1):
monkeypatch.setattr(Config, 'new_file', True)
difference = lib1.compare(NonExistingFile('/nonexisting', lib1))
@@ -118,7 +118,7 @@ def dbgsym_dir2():
def dbgsym_differences(dbgsym_dir1, dbgsym_dir2):
return dbgsym_dir1.compare(dbgsym_dir2)
- at skip_unless_tool_exists('readelf', 'objdump', 'objcopy')
+ at skip_unless_tools_exist('readelf', 'objdump', 'objcopy')
@pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
def test_differences_with_dbgsym(dbgsym_differences):
output_text(dbgsym_differences, print)
@@ -128,7 +128,7 @@ def test_differences_with_dbgsym(dbgsym_differences):
assert bin_details.details[1].source1.startswith('objdump')
assert 'test-cases/dbgsym/package/test.c:2' in bin_details.details[1].unified_diff
- at skip_unless_tool_exists('readelf', 'objdump', 'objcopy')
+ at skip_unless_tools_exist('readelf', 'objdump', 'objcopy')
@pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
def test_original_gnu_debuglink(dbgsym_differences):
bin_details = dbgsym_differences.details[2].details[0].details[0]
diff --git a/tests/comparators/test_epub.py b/tests/comparators/test_epub.py
index b33f8b0..0a402bf 100644
--- a/tests/comparators/test_epub.py
+++ b/tests/comparators/test_epub.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.zip import ZipFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
epub1 = load_fixture(data('test1.epub'))
epub2 = load_fixture(data('test2.epub'))
@@ -39,7 +39,7 @@ def test_no_differences(epub1):
def differences(epub1, epub2):
return epub1.compare(epub2).details
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_differences(differences):
assert differences[0].source1 == 'zipinfo {}'
assert differences[0].source2 == 'zipinfo {}'
@@ -52,7 +52,7 @@ def test_differences(differences):
expected_diff = open(data('epub_expected_diffs')).read()
assert expected_diff == "".join(map(lambda x: x.unified_diff, differences))
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_compare_non_existing(monkeypatch, epub1):
monkeypatch.setattr(Config.general, 'new_file', True)
difference = epub1.compare(NonExistingFile('/nonexisting', epub1))
diff --git a/tests/comparators/test_fonts.py b/tests/comparators/test_fonts.py
index 747de24..fefd0d3 100644
--- a/tests/comparators/test_fonts.py
+++ b/tests/comparators/test_fonts.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.fonts import TtfFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
ttf1 = load_fixture(data('Samyak-Malayalam1.ttf'))
@@ -40,12 +40,12 @@ def test_no_differences(ttf1):
def differences(ttf1, ttf2):
return ttf1.compare(ttf2).details
- at skip_unless_tool_exists('showttf')
+ at skip_unless_tools_exist('showttf')
def test_diff(differences):
expected_diff = open(data('ttf_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('showttf')
+ at skip_unless_tools_exist('showttf')
def test_compare_non_existing(monkeypatch, ttf1):
monkeypatch.setattr(Config, 'new_file', True)
difference = ttf1.compare(NonExistingFile('/nonexisting', ttf1))
diff --git a/tests/comparators/test_fsimage.py b/tests/comparators/test_fsimage.py
index 603f9c8..bdb527e 100644
--- a/tests/comparators/test_fsimage.py
+++ b/tests/comparators/test_fsimage.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.binary import NonExistingFile
from diffoscope.comparators.fsimage import FsImageFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
try:
import guestfs
@@ -49,7 +49,7 @@ def test_identification(img1):
assert isinstance(img1, FsImageFile)
@pytest.mark.skipif(not guestfs_working(), reason='guestfs not working on the system')
- at skip_unless_tool_exists('qemu-img')
+ at skip_unless_tools_exist('qemu-img')
@pytest.mark.skipif(miss_guestfs, reason='guestfs is missing')
def test_no_differences(img1):
difference = img1.compare(img1)
@@ -60,7 +60,7 @@ def differences(img1, img2):
return img1.compare(img2).details
@pytest.mark.skipif(not guestfs_working(), reason='guestfs not working on the system')
- at skip_unless_tool_exists('qemu-img')
+ at skip_unless_tools_exist('qemu-img')
@pytest.mark.skipif(miss_guestfs, reason='guestfs is missing')
def test_differences(differences):
assert differences[0].source1 == 'test1.ext4.tar'
@@ -78,7 +78,7 @@ def test_differences(differences):
assert expected_diff == found_diff
@pytest.mark.skipif(not guestfs_working(), reason='guestfs not working on the system')
- at skip_unless_tool_exists('qemu-img')
+ at skip_unless_tools_exist('qemu-img')
@pytest.mark.skipif(miss_guestfs, reason='guestfs is missing')
def test_compare_non_existing(monkeypatch, img1):
monkeypatch.setattr(Config.general, 'new_file', True)
diff --git a/tests/comparators/test_gettext.py b/tests/comparators/test_gettext.py
index 534cdd6..2b1548d 100644
--- a/tests/comparators/test_gettext.py
+++ b/tests/comparators/test_gettext.py
@@ -24,7 +24,7 @@ from diffoscope.config import Config
from diffoscope.comparators.binary import NonExistingFile
from diffoscope.comparators.gettext import MoFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
mo1 = load_fixture(data('test1.mo'))
mo2 = load_fixture(data('test2.mo'))
@@ -40,7 +40,7 @@ def test_no_differences(mo1):
def differences(mo1, mo2):
return mo1.compare(mo2).details
- at skip_unless_tool_exists('msgunfmt')
+ at skip_unless_tools_exist('msgunfmt')
def test_diff(differences):
expected_diff = open(data('mo_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
@@ -48,13 +48,13 @@ def test_diff(differences):
mo_no_charset = load_fixture(data('test_no_charset.mo'))
mo_iso8859_1 = load_fixture(data('test_iso8859-1.mo'))
- at skip_unless_tool_exists('msgunfmt')
+ at skip_unless_tools_exist('msgunfmt')
def test_charsets(mo_no_charset, mo_iso8859_1):
difference = mo_no_charset.compare(mo_iso8859_1)
expected_diff = codecs.open(data('mo_charsets_expected_diff'), encoding='utf-8').read()
assert difference.details[0].unified_diff == expected_diff
- at skip_unless_tool_exists('msgunfmt')
+ at skip_unless_tools_exist('msgunfmt')
def test_compare_non_existing(monkeypatch, mo1):
monkeypatch.setattr(Config, 'new_file', True)
difference = mo1.compare(NonExistingFile('/nonexisting', mo1))
diff --git a/tests/comparators/test_haskell.py b/tests/comparators/test_haskell.py
index b9233d0..3c8df05 100644
--- a/tests/comparators/test_haskell.py
+++ b/tests/comparators/test_haskell.py
@@ -21,12 +21,12 @@ import pytest
from diffoscope.comparators.haskell import HiFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
haskell1 = load_fixture(data('test1.hi'))
haskell2 = load_fixture(data('test2.hi'))
- at skip_unless_tool_exists('ghc')
+ at skip_unless_tools_exist('ghc')
def test_identification(haskell1):
assert isinstance(haskell1, HiFile)
@@ -37,7 +37,7 @@ def test_no_differences(haskell1):
def differences(haskell1, haskell2):
return haskell1.compare(haskell2).details
- at skip_unless_tool_exists('ghc')
+ at skip_unless_tools_exist('ghc')
def test_diff(differences):
with open(data('haskell_expected_diff')) as f:
expected_diff = f.read()
diff --git a/tests/comparators/test_icc.py b/tests/comparators/test_icc.py
index 42adfd3..9fe872f 100644
--- a/tests/comparators/test_icc.py
+++ b/tests/comparators/test_icc.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.icc import IccFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
icc1 = load_fixture(data('test1.icc'))
icc2 = load_fixture(data('test2.icc'))
@@ -39,12 +39,12 @@ def test_no_differences(icc1):
def differences(icc1, icc2):
return icc1.compare(icc2).details
- at skip_unless_tool_exists('cd-iccdump')
+ at skip_unless_tools_exist('cd-iccdump')
def test_diff(differences):
expected_diff = open(data('icc_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('cd-iccdump')
+ at skip_unless_tools_exist('cd-iccdump')
def test_compare_non_existing(monkeypatch, icc1):
monkeypatch.setattr(Config, 'new_file', True)
difference = icc1.compare(NonExistingFile('/nonexisting', icc1))
diff --git a/tests/comparators/test_image.py b/tests/comparators/test_image.py
index cd58f27..6691c30 100644
--- a/tests/comparators/test_image.py
+++ b/tests/comparators/test_image.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.image import ImageFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
image1 = load_fixture(data('test1.jpg'))
image2 = load_fixture(data('test2.jpg'))
@@ -39,12 +39,12 @@ def test_no_differences(image1):
def differences(image1, image2):
return image1.compare(image2).details
- at skip_unless_tool_exists('img2txt')
+ at skip_unless_tools_exist('img2txt')
def test_diff(differences):
expected_diff = open(data('image_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('img2txt')
+ at skip_unless_tools_exist('img2txt')
def test_compare_non_existing(monkeypatch, image1):
monkeypatch.setattr(Config, 'new_file', True)
difference = image1.compare(NonExistingFile('/nonexisting', image1))
diff --git a/tests/comparators/test_iso9660.py b/tests/comparators/test_iso9660.py
index 151c306..0cd6aee 100644
--- a/tests/comparators/test_iso9660.py
+++ b/tests/comparators/test_iso9660.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.binary import NonExistingFile
from diffoscope.comparators.iso9660 import Iso9660File
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
iso1 = load_fixture(data('test1.iso'))
iso2 = load_fixture(data('test2.iso'))
@@ -39,30 +39,30 @@ def test_no_differences(iso1):
def differences(iso1, iso2):
return iso1.compare(iso2).details
- at skip_unless_tool_exists('isoinfo')
+ at skip_unless_tools_exist('isoinfo')
def test_iso9660_content(differences):
expected_diff = open(data('iso9660_content_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('isoinfo')
+ at skip_unless_tools_exist('isoinfo')
def test_iso9660_rockridge(differences):
expected_diff = open(data('iso9660_rockridge_expected_diff')).read()
assert differences[1].unified_diff == expected_diff
- at skip_unless_tool_exists('isoinfo')
+ at skip_unless_tools_exist('isoinfo')
def test_symlink(differences):
assert differences[3].comment == 'symlink'
expected_diff = open(data('symlink_expected_diff')).read()
assert differences[3].unified_diff == expected_diff
- at skip_unless_tool_exists('isoinfo')
+ at skip_unless_tools_exist('isoinfo')
def test_compressed_files(differences):
assert differences[2].source1 == 'text'
assert differences[2].source2 == 'text'
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[2].unified_diff == expected_diff
- at skip_unless_tool_exists('isoinfo')
+ at skip_unless_tools_exist('isoinfo')
def test_compare_non_existing(monkeypatch, iso1):
monkeypatch.setattr(Config.general, 'new_file', True)
difference = iso1.compare(NonExistingFile('/nonexisting', iso1))
diff --git a/tests/comparators/test_java.py b/tests/comparators/test_java.py
index b5044ed..7229b21 100644
--- a/tests/comparators/test_java.py
+++ b/tests/comparators/test_java.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.java import ClassFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
class1 = load_fixture(data('Test1.class'))
class2 = load_fixture(data('Test2.class'))
@@ -39,12 +39,12 @@ def test_no_differences(class1):
def differences(class1, class2):
return class1.compare(class2).details
- at skip_unless_tool_exists('javap')
+ at skip_unless_tools_exist('javap')
def test_diff(differences):
expected_diff = open(data('class_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('javap')
+ at skip_unless_tools_exist('javap')
def test_compare_non_existing(monkeypatch, class1):
monkeypatch.setattr(Config, 'new_file', True)
difference = class1.compare(NonExistingFile('/nonexisting', class1))
diff --git a/tests/comparators/test_macho.py b/tests/comparators/test_macho.py
index d2ef29c..f280876 100644
--- a/tests/comparators/test_macho.py
+++ b/tests/comparators/test_macho.py
@@ -25,7 +25,7 @@ from diffoscope.config import Config
from diffoscope.comparators.macho import MachoFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
obj1 = load_fixture(data('test1.macho'))
obj2 = load_fixture(data('test2.macho'))
@@ -41,14 +41,14 @@ def test_obj_no_differences(obj1):
def obj_differences(obj1, obj2):
return obj1.compare(obj2).details
- at skip_unless_tool_exists('otool', 'lipo')
+ at skip_unless_tools_exist('otool', 'lipo')
def test_obj_compare_non_existing(monkeypatch, obj1):
monkeypatch.setattr(Config, 'new_file', True)
difference = obj1.compare(NonExistingFile('/nonexisting', obj1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
- at skip_unless_tool_exists('otool', 'lipo')
+ at skip_unless_tools_exist('otool', 'lipo')
def test_diff(obj_differences):
assert len(obj_differences) == 4
l = ['macho_expected_diff_arch', 'macho_expected_diff_headers', 'macho_expected_diff_loadcommands', 'macho_expected_diff_disassembly']
diff --git a/tests/comparators/test_mono.py b/tests/comparators/test_mono.py
index b71f36c..6f12fdf 100644
--- a/tests/comparators/test_mono.py
+++ b/tests/comparators/test_mono.py
@@ -23,7 +23,7 @@ from diffoscope.config import Config
from diffoscope.comparators.mono import MonoExeFile
from diffoscope.comparators.binary import NonExistingFile
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
# these were generated with:
@@ -44,12 +44,12 @@ def test_no_differences(exe1):
def differences(exe1, exe2):
return exe1.compare(exe2).details
- at skip_unless_tool_exists('pedump')
+ at skip_unless_tools_exist('pedump')
def test_diff(differences):
expected_diff = open(data('pe_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('pedump')
+ at skip_unless_tools_exist('pedump')
def test_compare_non_existing(monkeypatch, exe1):
monkeypatch.setattr(Config, 'new_file', True)
difference = exe1.compare(NonExistingFile('/nonexisting', exe1))
diff --git a/tests/comparators/test_pdf.py b/tests/comparators/test_pdf.py
index 8ba8161..913d4a4 100644
--- a/tests/comparators/test_pdf.py
+++ b/tests/comparators/test_pdf.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.pdf import PdfFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
pdf1 = load_fixture(data('test1.pdf'))
@@ -38,16 +38,16 @@ def test_no_differences(pdf1):
def differences(pdf1, pdf2):
return pdf1.compare(pdf2).details
- at skip_unless_tool_exists('pdftk', 'pdftotext')
+ at skip_unless_tools_exist('pdftk', 'pdftotext')
def test_text_diff(differences):
expected_diff = open(data('pdf_text_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('pdftk', 'pdftotext')
+ at skip_unless_tools_exist('pdftk', 'pdftotext')
def test_internal_diff(differences):
expected_diff = open(data('pdf_internal_expected_diff')).read()
assert differences[1].unified_diff == expected_diff
- at skip_unless_tool_exists('pdftk', 'pdftotext')
+ at skip_unless_tools_exist('pdftk', 'pdftotext')
def test_compare_non_existing(monkeypatch, pdf1):
assert_non_existing(monkeypatch, pdf1, has_null_source=False)
diff --git a/tests/comparators/test_png.py b/tests/comparators/test_png.py
index 5fb4781..fb45dbc 100644
--- a/tests/comparators/test_png.py
+++ b/tests/comparators/test_png.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.png import PngFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
png1 = load_fixture(data('test1.png'))
@@ -38,11 +38,11 @@ def test_no_differences(png1):
def differences(png1, png2):
return png1.compare(png2).details
- at skip_unless_tool_exists('sng')
+ at skip_unless_tools_exist('sng')
def test_diff(differences):
expected_diff = open(data('png_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('sng')
+ at skip_unless_tools_exist('sng')
def test_compare_non_existing(monkeypatch, png1):
assert_non_existing(monkeypatch, png1, has_null_source=False)
diff --git a/tests/comparators/test_ppu.py b/tests/comparators/test_ppu.py
index a3e4766..a66f9a9 100644
--- a/tests/comparators/test_ppu.py
+++ b/tests/comparators/test_ppu.py
@@ -22,7 +22,7 @@ import pytest
from diffoscope.comparators.ppu import PpuFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
# These test files were taken from two different builds of the Debian package
@@ -34,7 +34,7 @@ from utils import skip_unless_tool_exists, data, load_fixture, \
file1 = load_fixture(data('test1.ppu'))
file2 = load_fixture(data('test2.ppu'))
- at skip_unless_tool_exists('ppudump')
+ at skip_unless_tools_exist('ppudump')
def test_identification(file1):
assert isinstance(file1, PpuFile)
@@ -46,12 +46,12 @@ def test_no_differences(file1):
def differences(file1, file2):
return file1.compare(file2).details
- at skip_unless_tool_exists('ppudump')
+ at skip_unless_tools_exist('ppudump')
def test_diff(differences):
print(differences[0].unified_diff)
expected_diff = open(data('ppu_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('ppudump')
+ at skip_unless_tools_exist('ppudump')
def test_compare_non_existing(monkeypatch, file1):
assert_non_existing(monkeypatch, file1, has_null_source=False)
diff --git a/tests/comparators/test_ps.py b/tests/comparators/test_ps.py
index 7006abe..85c82e5 100644
--- a/tests/comparators/test_ps.py
+++ b/tests/comparators/test_ps.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.ps import PsFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
ps1 = load_fixture(data('test1.ps'))
@@ -38,16 +38,16 @@ def test_no_differences(ps1):
def differences(ps1, ps2):
return ps1.compare(ps2)
- at skip_unless_tool_exists('ps2ascii')
+ at skip_unless_tools_exist('ps2ascii')
def test_internal_diff(differences):
expected_diff = open(data('ps_internal_expected_diff')).read()
assert differences.unified_diff == expected_diff
- at skip_unless_tool_exists('ps2ascii')
+ at skip_unless_tools_exist('ps2ascii')
def test_text_diff(differences):
expected_diff = open(data('ps_text_expected_diff')).read()
assert differences.details[0].unified_diff == expected_diff
- at skip_unless_tool_exists('ps2ascii')
+ at skip_unless_tools_exist('ps2ascii')
def test_compare_non_existing(monkeypatch, ps1):
assert_non_existing(monkeypatch, ps1, has_null_source=False)
diff --git a/tests/comparators/test_rlib.py b/tests/comparators/test_rlib.py
index 4ae5735..22ff362 100644
--- a/tests/comparators/test_rlib.py
+++ b/tests/comparators/test_rlib.py
@@ -23,7 +23,7 @@ import pytest
from diffoscope.comparators.ar import ArFile
from diffoscope.comparators.utils import diff_ignore_line_numbers
-from utils import skip_unless_tool_exists, tool_older_than, data, \
+from utils import skip_unless_tools_exist, tool_older_than, data, \
load_fixture, assert_non_existing
rlib1 = load_fixture(data('test1.rlib'))
@@ -59,7 +59,7 @@ def test_item2_rust_metadata_bin(differences):
assert differences[2].source1 == 'rust.metadata.bin'
assert differences[2].source2 == 'rust.metadata.bin'
- at skip_unless_tool_exists('llvm-dis')
+ at skip_unless_tools_exist('llvm-dis')
@pytest.mark.skipif(tool_older_than(['llvm-config', '--version'], '3.8'), reason='llvm version too low')
def test_item3_deflate_llvm_bitcode(differences):
assert differences[3].source1 == 'alloc_system-d16b8f0e.0.bytecode.deflate'
diff --git a/tests/comparators/test_rpm.py b/tests/comparators/test_rpm.py
index 74032b4..72fed8a 100644
--- a/tests/comparators/test_rpm.py
+++ b/tests/comparators/test_rpm.py
@@ -19,7 +19,7 @@
import pytest
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
try:
@@ -45,14 +45,14 @@ def differences(rpm1, rpm2):
return rpm1.compare(rpm2).details
@pytest.mark.skipif(miss_rpm_module, reason='rpm module is not installed')
- at skip_unless_tool_exists('rpm2cpio')
+ at skip_unless_tools_exist('rpm2cpio')
def test_header(differences):
assert differences[0].source1 == 'header'
expected_diff = open(data('rpm_header_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
@pytest.mark.skipif(miss_rpm_module, reason='rpm module is not installed')
- at skip_unless_tool_exists('rpm2cpio')
+ at skip_unless_tools_exist('rpm2cpio')
def test_listing(differences):
assert differences[1].source1 == 'content'
assert differences[1].details[0].source1 == 'file list'
@@ -60,7 +60,7 @@ def test_listing(differences):
assert differences[1].details[0].unified_diff == expected_diff
@pytest.mark.skipif(miss_rpm_module, reason='rpm module is not installed')
- at skip_unless_tool_exists('rpm2cpio')
+ at skip_unless_tools_exist('rpm2cpio')
def test_content(differences):
assert differences[1].source1 == 'content'
assert differences[1].details[1].source1 == './dir/text'
@@ -68,6 +68,6 @@ def test_content(differences):
assert differences[1].details[1].unified_diff == expected_diff
@pytest.mark.skipif(miss_rpm_module, reason='rpm module is not installed')
- at skip_unless_tool_exists('rpm2cpio')
+ at skip_unless_tools_exist('rpm2cpio')
def test_compare_non_existing(monkeypatch, rpm1):
assert_non_existing(monkeypatch, rpm1)
diff --git a/tests/comparators/test_sqlite.py b/tests/comparators/test_sqlite.py
index a185bd0..f05c5f1 100644
--- a/tests/comparators/test_sqlite.py
+++ b/tests/comparators/test_sqlite.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.sqlite import Sqlite3Database
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
sqlite3db1 = load_fixture(data('test1.sqlite3'))
@@ -38,11 +38,11 @@ def test_no_differences(sqlite3db1):
def differences(sqlite3db1, sqlite3db2):
return sqlite3db1.compare(sqlite3db2).details
- at skip_unless_tool_exists('sqlite3')
+ at skip_unless_tools_exist('sqlite3')
def test_diff(differences):
expected_diff = open(data('sqlite3_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('sqlite3')
+ at skip_unless_tools_exist('sqlite3')
def test_compare_non_existing(monkeypatch, sqlite3db1):
assert_non_existing(monkeypatch, sqlite3db1, has_null_source=False)
diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index 41c1c85..3310927 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.squashfs import SquashfsFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
squashfs1 = load_fixture(data('test1.squashfs'))
@@ -43,24 +43,24 @@ def test_no_warnings(capfd, squashfs1, squashfs2):
def differences(squashfs1, squashfs2):
return squashfs1.compare(squashfs2).details
- at skip_unless_tool_exists('unsquashfs')
+ at skip_unless_tools_exist('unsquashfs')
def test_superblock(differences):
expected_diff = open(data('squashfs_superblock_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('unsquashfs')
+ at skip_unless_tools_exist('unsquashfs')
def test_symlink(differences):
assert differences[2].comment == 'symlink'
expected_diff = open(data('symlink_expected_diff')).read()
assert differences[2].unified_diff == expected_diff
- at skip_unless_tool_exists('unsquashfs')
+ at skip_unless_tools_exist('unsquashfs')
def test_compressed_files(differences):
assert differences[3].source1 == '/text'
assert differences[3].source2 == '/text'
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[3].unified_diff == expected_diff
- at skip_unless_tool_exists('unsquashfs')
+ at skip_unless_tools_exist('unsquashfs')
def test_compare_non_existing(monkeypatch, squashfs1):
assert_non_existing(monkeypatch, squashfs1)
diff --git a/tests/comparators/test_utils.py b/tests/comparators/test_utils.py
index cefdd05..6f9fd89 100644
--- a/tests/comparators/test_utils.py
+++ b/tests/comparators/test_utils.py
@@ -24,7 +24,7 @@ from diffoscope.config import Config
from diffoscope.difference import Difference
from diffoscope.comparators.utils import Command
-from utils import skip_unless_tool_exists, data, load_fixture
+from utils import skip_unless_tools_exist, data, load_fixture
try:
import tlsh # noqa
@@ -36,12 +36,12 @@ fuzzy_tar1 = load_fixture(data('fuzzy1.tar'))
fuzzy_tar2 = load_fixture(data('fuzzy2.tar'))
fuzzy_tar3 = load_fixture(data('fuzzy3.tar'))
- at skip_unless_tool_exists()
-def test_skip_unless_tool_exists_empty():
+ at skip_unless_tools_exist()
+def test_skip_unless_tools_exist_empty():
assert False, "Test should always be skipped"
- at skip_unless_tool_exists('/missing')
-def test_skip_unless_tool_exists_missing():
+ at skip_unless_tools_exist('/missing')
+def test_skip_unless_tools_exist_missing():
assert False, "Test should always be skipped"
@pytest.mark.skipif(miss_tlsh, reason='tlsh is missing')
@@ -78,7 +78,7 @@ def test_no_fuzzy_matching_new_file(monkeypatch, fuzzy_tar_in_tar1, fuzzy_tar_in
assert difference.details[1].source2 == '/dev/null'
assert difference.details[2].source1 == '/dev/null'
- at skip_unless_tool_exists('tee')
+ at skip_unless_tools_exist('tee')
def test_trim_stderr_in_command():
class FillStderr(Command):
def cmdline(self):
diff --git a/tests/comparators/test_xz.py b/tests/comparators/test_xz.py
index b84f8bf..bc326bd 100644
--- a/tests/comparators/test_xz.py
+++ b/tests/comparators/test_xz.py
@@ -24,7 +24,7 @@ from diffoscope.comparators import specialize
from diffoscope.comparators.xz import XzFile
from diffoscope.comparators.binary import FilesystemFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
TEST_FILE1_PATH = data('test1.xz')
@@ -44,12 +44,12 @@ def test_no_differences(xz1):
def differences(xz1, xz2):
return xz1.compare(xz2).details
- at skip_unless_tool_exists('xz')
+ at skip_unless_tools_exist('xz')
def test_content_source(differences):
assert differences[0].source1 == 'test1'
assert differences[0].source2 == 'test2'
- at skip_unless_tool_exists('xz')
+ at skip_unless_tools_exist('xz')
def test_content_source_without_extension(tmpdir):
path1 = str(tmpdir.join('test1'))
path2 = str(tmpdir.join('test2'))
@@ -61,11 +61,11 @@ def test_content_source_without_extension(tmpdir):
assert difference[0].source1 == 'test1-content'
assert difference[0].source2 == 'test2-content'
- at skip_unless_tool_exists('xz')
+ at skip_unless_tools_exist('xz')
def test_content_diff(differences):
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('xz')
+ at skip_unless_tools_exist('xz')
def test_compare_non_existing(monkeypatch, xz1):
assert_non_existing(monkeypatch, xz1)
diff --git a/tests/comparators/test_zip.py b/tests/comparators/test_zip.py
index bd8b26b..a11f34a 100644
--- a/tests/comparators/test_zip.py
+++ b/tests/comparators/test_zip.py
@@ -21,7 +21,7 @@ import pytest
from diffoscope.comparators.zip import ZipFile, MozillaZipFile
-from utils import skip_unless_tool_exists, data, load_fixture, \
+from utils import skip_unless_tools_exist, data, load_fixture, \
assert_non_existing
zip1 = load_fixture(data('test1.zip'))
@@ -38,19 +38,19 @@ def test_no_differences(zip1):
def differences(zip1, zip2):
return zip1.compare(zip2).details
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_metadata(differences):
expected_diff = open(data('zip_zipinfo_expected_diff')).read()
assert differences[0].unified_diff == expected_diff
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_compressed_files(differences):
assert differences[1].source1 == 'dir/text'
assert differences[1].source2 == 'dir/text'
expected_diff = open(data('text_ascii_expected_diff')).read()
assert differences[1].unified_diff == expected_diff
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_compare_non_existing(monkeypatch, zip1):
assert_non_existing(monkeypatch, zip1)
@@ -71,20 +71,20 @@ def test_mozzip_no_differences(mozzip1):
def mozzip_differences(mozzip1, mozzip2):
return mozzip1.compare(mozzip2).details
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_mozzip_metadata(mozzip_differences):
expected_diff = open(data('mozzip_zipinfo_expected_diff')).read()
diff = mozzip_differences[0].unified_diff
assert (diff.replace(TEST_MOZZIP1_PATH, 'test1.mozzip')
.replace(TEST_MOZZIP2_PATH, 'test2.mozzip')) == expected_diff
- at skip_unless_tool_exists('zipinfo')
+ at 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 = open(data('text_ascii_expected_diff')).read()
assert mozzip_differences[1].unified_diff == expected_diff
- at skip_unless_tool_exists('zipinfo')
+ at skip_unless_tools_exist('zipinfo')
def test_mozzip_compare_non_existing(monkeypatch, mozzip1):
assert_non_existing(monkeypatch, mozzip1)
diff --git a/tests/comparators/utils.py b/tests/comparators/utils.py
index cfe89d0..5a18cfb 100644
--- a/tests/comparators/utils.py
+++ b/tests/comparators/utils.py
@@ -36,10 +36,10 @@ from diffoscope.comparators.binary import FilesystemFile, NonExistingFile
def set_locale():
diffoscope.set_locale()
-def skip_unless_tool_exists(*alternatives):
+def skip_unless_tools_exist(*required):
return pytest.mark.skipif(
- not any(find_executable(x) for x in alternatives),
- reason="missing {}".format(" or ".join(alternatives)),
+ not required or any(find_executable(x) is None for x in required),
+ reason="requires {}".format(" and ".join(required)),
)
def load_fixture(filename):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list