diff --git a/britney.py b/britney.py index 8e44e3a..53326c4 100755 --- a/britney.py +++ b/britney.py @@ -256,7 +256,7 @@ class Britney(object): 'DEBUG': 'N', } - def record_factory(*args, **kwargs): + def record_factory(*args, **kwargs): # pragma: no cover record = old_factory(*args, **kwargs) try: record.shortlevelname = short_level_mapping[record.levelname] @@ -453,7 +453,7 @@ class Britney(object): not getattr(self.options, k.lower()): setattr(self.options, k.lower(), v) - if hasattr(self.options, 'components'): + if hasattr(self.options, 'components'): # pragma: no cover self.logger.error("The COMPONENTS configuration has been removed.") self.logger.error("Britney will read the value from the Release file automatically") sys.exit(1) @@ -462,7 +462,7 @@ class Britney(object): try: self.suite_info = suite_loader.load_suites() - except MissingRequiredConfigurationError as e: + except MissingRequiredConfigurationError as e: # pragma: no cover self.logger.error("Could not load the suite content due to missing configuration: %s", str(e)) sys.exit(1) self.all_binaries = suite_loader.all_binaries() diff --git a/britney2/inputs/suiteloader.py b/britney2/inputs/suiteloader.py index 3c66174..62a56c6 100644 --- a/britney2/inputs/suiteloader.py +++ b/britney2/inputs/suiteloader.py @@ -64,7 +64,7 @@ class SuiteContentLoader(object): return self._all_binaries @abstractmethod - def load_suites(self): + def load_suites(self): # pragma: no cover pass @@ -146,7 +146,7 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader): self.logger.info("Using components listed in Release file: %s", ' '.join(self._components)) if self._architectures is None: - if release_file is None: + if release_file is None: # pragma: no cover self.logger.error("No configured architectures and there is no release file in the %s suite.", target_suite.name) self.logger.error("Please check if there is a \"Release\" file in %s", diff --git a/britney2/policies/policy.py b/britney2/policies/policy.py index 6c5b523..42058aa 100644 --- a/britney2/policies/policy.py +++ b/britney2/policies/policy.py @@ -334,11 +334,11 @@ class AgePolicy(BasePolicy): continue # ) l = line.split() - if len(l) != 3: + if len(l) != 3: # pragma: no cover continue try: dates[l[0]] = (l[1], int(l[2])) - except ValueError: + except ValueError: # pragma: no cover pass except FileNotFoundError: if not using_new_name: @@ -549,7 +549,7 @@ class RCBugPolicy(BasePolicy): self.logger.info("Loading RC bugs data from %s", filename) for line in open(filename, encoding='ascii'): l = line.split() - if len(l) != 2: + if len(l) != 2: # pragma: no cover self.logger.warning("Malformed line found in line %s", line) continue pkg = l[0] diff --git a/britney2/utils.py b/britney2/utils.py index 5b2ee36..c887f2e 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -73,7 +73,7 @@ def ifilter_only(container, iterable=None): # iter_except is from the "itertools" recipe -def iter_except(func, exception, first=None): +def iter_except(func, exception, first=None): # pragma: no cover - itertools recipe function """ Call a function repeatedly until an exception is raised. Converts a call-until-exception interface to an iterator interface. @@ -308,7 +308,7 @@ def write_excuses(excuselist, dest_file, output_format="yaml"): for e in excuselist: f.write("
  • %s" % e.html()) f.write("\n") - else: + else: # pragma: no cover raise ValueError('Output format must be either "yaml or "legacy-html"') @@ -592,7 +592,7 @@ def possibly_compressed(path, *, permitted_compressions=None): cpath = "%s.%s" % (path, ext) if os.path.exists(cpath): return cpath - raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path) + raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path) # pragma: no cover def create_provides_map(packages):