[diffoscope] 01/03: tests: Increase coverage by adding "# noqa" in relevant parts.

Chris Lamb chris at chris-lamb.co.uk
Sun Jan 22 07:31:44 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 4624a4eb50cab3ca165b4d07b752fcc9b87774f1
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Jan 22 19:26:22 2017 +1300

    tests: Increase coverage by adding "# noqa" in relevant parts.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/image.py            | 2 +-
 diffoscope/comparators/utils/compare.py    | 2 +-
 diffoscope/comparators/utils/file.py       | 2 +-
 diffoscope/comparators/utils/fuzzy.py      | 2 +-
 diffoscope/comparators/utils/specialize.py | 2 +-
 diffoscope/config.py                       | 4 ++--
 diffoscope/tools.py                        | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/diffoscope/comparators/image.py b/diffoscope/comparators/image.py
index 5006e13..fc3bf23 100644
--- a/diffoscope/comparators/image.py
+++ b/diffoscope/comparators/image.py
@@ -101,7 +101,7 @@ class ICOImageFile(File):
         try:
             png_a, png_b = [ICOImageFile.convert(x) for x in (self, other)]
         except subprocess.CalledProcessError:
-            pass
+            pass  # noqa
         else:
             differences.append(Difference.from_command(Img2Txt, png_a, png_b))
 
diff --git a/diffoscope/comparators/utils/compare.py b/diffoscope/comparators/utils/compare.py
index 80053c7..1724487 100644
--- a/diffoscope/comparators/utils/compare.py
+++ b/diffoscope/comparators/utils/compare.py
@@ -36,7 +36,7 @@ from .specialize import specialize
 
 try:
     import tlsh
-except ImportError:
+except ImportError:  # noqa
     tlsh = None
 
 logger = logging.getLogger(__name__)
diff --git a/diffoscope/comparators/utils/file.py b/diffoscope/comparators/utils/file.py
index 1c59df8..40da313 100644
--- a/diffoscope/comparators/utils/file.py
+++ b/diffoscope/comparators/utils/file.py
@@ -31,7 +31,7 @@ from diffoscope.difference import Difference
 
 try:
     import tlsh
-except ImportError:
+except ImportError:  # noqa
     tlsh = None
 
 SMALL_FILE_THRESHOLD = 65536 # 64 kiB
diff --git a/diffoscope/comparators/utils/fuzzy.py b/diffoscope/comparators/utils/fuzzy.py
index 4d6b865..c365703 100644
--- a/diffoscope/comparators/utils/fuzzy.py
+++ b/diffoscope/comparators/utils/fuzzy.py
@@ -24,7 +24,7 @@ from diffoscope.config import Config
 
 try:
     import tlsh
-except ImportError:
+except ImportError:  # noqa
     tlsh = None
 
 logger = logging.getLogger(__name__)
diff --git a/diffoscope/comparators/utils/specialize.py b/diffoscope/comparators/utils/specialize.py
index b30c707..28e6cbb 100644
--- a/diffoscope/comparators/utils/specialize.py
+++ b/diffoscope/comparators/utils/specialize.py
@@ -71,7 +71,7 @@ def import_comparators(comparators):
 
             result.append(getattr(mod, klass_name))
             break
-        else:
+        else:  # noqa
             raise ImportError(
                 "Could not import any of {}".format(', '.join(xs))
             )
diff --git a/diffoscope/config.py b/diffoscope/config.py
index 4db0d88..624c27c 100644
--- a/diffoscope/config.py
+++ b/diffoscope/config.py
@@ -45,7 +45,7 @@ class Config(object):
             self.check_constraints()
 
     def check_constraints(self):
-        if self.max_diff_block_lines < self.max_diff_block_lines_parent:
+        if self.max_diff_block_lines < self.max_diff_block_lines_parent:  # noqa
             raise ValueError("max_diff_block_lines ({0.max_diff_block_lines}) "
                 "cannot be smaller than max_diff_block_lines_parent "
                 "({0.max_diff_block_lines_parent})".format(self),
@@ -53,7 +53,7 @@ class Config(object):
 
         max_ = self.max_diff_block_lines_html_dir_ratio * \
             self.max_diff_block_lines
-        if self.max_diff_block_lines_saved < max_:
+        if self.max_diff_block_lines_saved < max_:  # noqa
             raise ValueError("max_diff_block_lines_saved "
                 "({0.max_diff_block_lines_saved}) cannot be smaller than "
                 "{0.max_diff_block_lines_html_dir_ratio} * "
diff --git a/diffoscope/tools.py b/diffoscope/tools.py
index 8af5aa3..8419710 100644
--- a/diffoscope/tools.py
+++ b/diffoscope/tools.py
@@ -65,4 +65,4 @@ def get_current_os():
         # FIXME: Will break under Python 3.7, see:
         # https://docs.python.org/3/library/platform.html#platform.linux_distribution
         return platform.linux_distribution()[0]
-    return system
+    return system  # noqa

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


More information about the diffoscope mailing list