[diffoscope] 03/03: Skip Haskell tests if GHC version does not match. (Closes: #835055)

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 21 21:15:05 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 c506dd2a6c912fe89604e5ec11df076f93a2cb69
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Aug 21 20:14:54 2016 +0100

    Skip Haskell tests if GHC version does not match. (Closes: #835055)
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/comparators/test_haskell.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/comparators/test_haskell.py b/tests/comparators/test_haskell.py
index 3c8df05..8439c87 100644
--- a/tests/comparators/test_haskell.py
+++ b/tests/comparators/test_haskell.py
@@ -19,6 +19,7 @@
 
 import pytest
 
+from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.haskell import HiFile
 
 from utils import skip_unless_tools_exist, data, load_fixture
@@ -28,6 +29,9 @@ haskell2 = load_fixture(data('test2.hi'))
 
 @skip_unless_tools_exist('ghc')
 def test_identification(haskell1):
+    if isinstance(haskell1, FilesystemFile):
+        pytest.skip("mismatch between system ghc and fixture")
+
     assert isinstance(haskell1, HiFile)
 
 def test_no_differences(haskell1):
@@ -38,7 +42,10 @@ def differences(haskell1, haskell2):
     return haskell1.compare(haskell2).details
 
 @skip_unless_tools_exist('ghc')
-def test_diff(differences):
+def test_diff(haskell1, differences):
+    if isinstance(haskell1, FilesystemFile):
+        pytest.skip("mismatch between system ghc and fixture")
+
     with open(data('haskell_expected_diff')) as f:
         expected_diff = f.read()
     assert differences[0].unified_diff == expected_diff

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


More information about the diffoscope mailing list