Commit 4624a4eb authored by Chris Lamb's avatar Chris Lamb 💬

tests: Increase coverage by adding "# noqa" in relevant parts.

Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent 15250944
......@@ -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))
......
......@@ -36,7 +36,7 @@ from .specialize import specialize
try:
import tlsh
except ImportError:
except ImportError: # noqa
tlsh = None
logger = logging.getLogger(__name__)
......
......@@ -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
......
......@@ -24,7 +24,7 @@ from diffoscope.config import Config
try:
import tlsh
except ImportError:
except ImportError: # noqa
tlsh = None
logger = logging.getLogger(__name__)
......
......@@ -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))
)
......
......@@ -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} * "
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment