[diffoscope] 03/05: tests: Drop output_* calls that are inconsistently applied to differences.

Chris Lamb chris at chris-lamb.co.uk
Sat Jan 21 12:16:21 CET 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 7778c24739cb104abbfcc028c92afc12a052e4d5
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Jan 21 17:58:33 2017 +1100

    tests: Drop output_* calls that are inconsistently applied to differences.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/comparators/test_cbfs.py         |  2 --
 tests/comparators/test_debian.py       | 25 -------------------------
 tests/comparators/test_directory.py    |  3 ---
 tests/comparators/test_elf.py          |  2 --
 tests/comparators/utils/nonexisting.py |  5 -----
 5 files changed, 37 deletions(-)

diff --git a/tests/comparators/test_cbfs.py b/tests/comparators/test_cbfs.py
index 85ddbca..49fa3fb 100644
--- a/tests/comparators/test_cbfs.py
+++ b/tests/comparators/test_cbfs.py
@@ -21,7 +21,6 @@ import struct
 import pytest
 import subprocess
 
-from diffoscope.presenters.text import output_text
 from diffoscope.comparators.cbfs import CbfsFile
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
@@ -73,7 +72,6 @@ def test_no_differences(rom1):
 @pytest.fixture
 def differences(rom1, rom2):
     difference = rom1.compare(rom2)
-    output_text(difference, print_func=print)
     return difference.details
 
 @skip_unless_tools_exist('cbfstool')
diff --git a/tests/comparators/test_debian.py b/tests/comparators/test_debian.py
index c8860a5..6d40f2d 100644
--- a/tests/comparators/test_debian.py
+++ b/tests/comparators/test_debian.py
@@ -21,7 +21,6 @@ import shutil
 import pytest
 
 from diffoscope.config import Config
-from diffoscope.presenters.text import output_text
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.missing_file import MissingFile
 from diffoscope.comparators.utils.specialize import specialize
@@ -102,43 +101,22 @@ def test_dot_changes_no_differences(dot_changes1):
 @pytest.fixture
 def dot_changes_differences(dot_changes1, dot_changes2):
     difference = dot_changes1.compare(dot_changes2)
-    output_text(difference, print_func=print)
-    return difference.details
-
- at pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
-def test_dot_changes_description(dot_changes_differences):
-    assert dot_changes_differences[0]
-    expected_diff = open(data('dot_changes_description_expected_diff')).read()
-    assert dot_changes_differences[0].unified_diff == expected_diff
-
- at pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
-def test_dot_changes_internal_diff(dot_changes_differences):
-    assert dot_changes_differences[2].source1 == 'test_1_all.deb'
-
- at pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
-def test_dot_changes_compare_non_existing(monkeypatch, dot_changes1):
-    monkeypatch.setattr(Config(), 'new_file', True)
-    difference = dot_changes1.compare(MissingFile('/nonexisting', dot_changes1))
-    output_text(difference, print_func=print)
     assert difference.source2 == '/nonexisting'
     assert difference.details[-1].source2 == '/dev/null'
 
 @pytest.fixture
 def dot_changes_differences_identical_contents_and_identical_files(dot_changes1, dot_changes3):
     difference = dot_changes1.compare(dot_changes3)
-    output_text(difference, print_func=print)
     return difference.details
 
 @pytest.fixture
 def dot_changes_differences_identical_contents_and_different_files(dot_changes1, dot_changes4):
     difference = dot_changes1.compare(dot_changes4)
-    output_text(difference, print_func=print)
     return difference.details
 
 @pytest.fixture
 def dot_changes_differences_different_contents_and_identical_files(dot_changes2, dot_changes4):
     difference = dot_changes4.compare(dot_changes2)
-    output_text(difference, print_func=print)
     return difference.details
 
 @pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
@@ -202,7 +180,6 @@ def test_dot_dsc_no_differences(dot_dsc1):
 @pytest.fixture
 def dot_dsc_differences(dot_dsc1, dot_dsc2):
     difference = dot_dsc1.compare(dot_dsc2)
-    output_text(difference, print_func=print)
     return difference.details
 
 @pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
@@ -213,7 +190,6 @@ def test_dot_dsc_internal_diff(dot_dsc_differences):
 def test_dot_dsc_compare_non_existing(monkeypatch, dot_dsc1):
     monkeypatch.setattr(Config(), 'new_file', True)
     difference = dot_dsc1.compare(MissingFile('/nonexisting', dot_dsc1))
-    output_text(difference, print_func=print)
     assert difference.source2 == '/nonexisting'
     assert difference.details[-1].source2 == '/dev/null'
 
@@ -255,7 +231,6 @@ def test_dot_buildinfo_no_differences(dot_buildinfo1):
 @pytest.fixture
 def dot_buildinfo_differences(dot_buildinfo1, dot_buildinfo2):
     difference = dot_buildinfo1.compare(dot_buildinfo2)
-    output_text(difference, print_func=print)
     return difference.details
 
 @pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
diff --git a/tests/comparators/test_directory.py b/tests/comparators/test_directory.py
index 6f09a9d..b655ef5 100644
--- a/tests/comparators/test_directory.py
+++ b/tests/comparators/test_directory.py
@@ -21,7 +21,6 @@ import os
 import shutil
 import pytest
 
-from diffoscope.presenters.text import output_text
 from diffoscope.comparators.directory import compare_directories
 
 from utils.data import data
@@ -55,12 +54,10 @@ def differences(tmpdir):
     return compare_directories(str(tmpdir.join('a')), str(tmpdir.join('b'))).details
 
 def test_content(differences):
-    output_text(differences[0], print_func=print)
     assert differences[0].source1 == 'dir'
     assert differences[0].details[0].source1 == 'text'
     expected_diff = open(data('text_ascii_expected_diff')).read()
     assert differences[0].details[0].unified_diff == expected_diff
 
 def test_stat(differences):
-    output_text(differences[0], print_func=print)
     assert 'stat' in differences[0].details[0].details[0].source1
diff --git a/tests/comparators/test_elf.py b/tests/comparators/test_elf.py
index ce08386..efd0f6c 100644
--- a/tests/comparators/test_elf.py
+++ b/tests/comparators/test_elf.py
@@ -21,7 +21,6 @@ import pytest
 import os.path
 
 from diffoscope.config import Config
-from diffoscope.presenters.text import output_text
 from diffoscope.comparators.elf import ElfFile, StaticLibFile
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.directory import FilesystemDirectory
@@ -130,7 +129,6 @@ def dbgsym_differences(dbgsym_dir1, dbgsym_dir2):
 @skip_if_binutils_does_not_support_x86()
 @pytest.mark.skipif(miss_debian_module, reason='debian module is not installed')
 def test_differences_with_dbgsym(dbgsym_differences):
-    output_text(dbgsym_differences, print)
     assert dbgsym_differences.details[2].source1 == 'data.tar.xz'
     bin_details = dbgsym_differences.details[2].details[0].details[0]
     assert bin_details.source1 == './usr/bin/test'
diff --git a/tests/comparators/utils/nonexisting.py b/tests/comparators/utils/nonexisting.py
index 2e3b07c..d44979b 100644
--- a/tests/comparators/utils/nonexisting.py
+++ b/tests/comparators/utils/nonexisting.py
@@ -19,8 +19,6 @@
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
 from diffoscope.config import Config
-from diffoscope.presenters.html import output_html
-from diffoscope.presenters.text import output_text
 from diffoscope.comparators.missing_file import MissingFile
 
 
@@ -30,9 +28,6 @@ def assert_non_existing(monkeypatch, fixture, has_null_source=True, has_details=
 
     difference = fixture.compare(MissingFile('/nonexisting', fixture))
 
-    output_html(difference, print_func=print)
-    output_text(difference, print_func=print)
-
     assert difference.source2 == '/nonexisting'
     assert not has_details or len(difference.details) > 0
     assert not has_null_source or difference.details[-1].source2 == '/dev/null'

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


More information about the diffoscope mailing list