[diffoscope] 01/04: Invert all the module_exist logic to prevent multiple confusing negations.

Chris Lamb chris at chris-lamb.co.uk
Fri Feb 10 11:08:05 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 e1775ed847b36b45ad7f821a4bb0169017607042
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Feb 10 23:06:49 2017 +1300

    Invert all the module_exist logic to prevent multiple confusing negations.
    
    Gbp-dch: ignore
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/comparators/utils/tools.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/comparators/utils/tools.py b/tests/comparators/utils/tools.py
index 5841853..8e84365 100644
--- a/tests/comparators/utils/tools.py
+++ b/tests/comparators/utils/tools.py
@@ -62,15 +62,15 @@ def get_supported_elf_formats():
     ).decode('utf-8').splitlines())
 
 def skip_unless_module_exists(name):
-    def module_exists(x):
+    def module_does_not_exist(x):
         try:
-            return importlib.util.find_spec(x) is not None
+            return importlib.util.find_spec(x) is None
         except ImportError:
             # Probing for submodules (eg. ``debian.deb822``) will attempt to
             # import ``debian`` so we must handle that failing.
-            return False
+            return True
 
     return pytest.mark.skipif(
-        module_exists(name),
+        module_does_not_exist(name),
         reason="requires {} module".format(name),
     )

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


More information about the diffoscope mailing list