From c4dc5269d29442e1b4fe62303b40adc9595fba14 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 30 Dec 2019 21:16:16 -0800 Subject: [PATCH] tests: remove some obscure things from coverage --- src/ocrmypdf/_validation.py | 2 +- src/ocrmypdf/hocrtransform.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ocrmypdf/_validation.py b/src/ocrmypdf/_validation.py index 1ebd422c..8b874ba6 100644 --- a/src/ocrmypdf/_validation.py +++ b/src/ocrmypdf/_validation.py @@ -314,7 +314,7 @@ def check_options(options): check_dependency_versions(options) -def check_closed_streams(options): +def check_closed_streams(options): # pragma: no cover """Work around Python issue with multiprocessing forking on closed streams https://bugs.python.org/issue28326 diff --git a/src/ocrmypdf/hocrtransform.py b/src/ocrmypdf/hocrtransform.py index e7c28e54..809f858e 100755 --- a/src/ocrmypdf/hocrtransform.py +++ b/src/ocrmypdf/hocrtransform.py @@ -88,7 +88,7 @@ class HocrTransform: if self.width is None or self.height is None: raise HocrTransformError("hocr file is missing page dimensions") - def __str__(self): + def __str__(self): # pragma: no cover """ Return the textual content of the HTML body """ @@ -190,7 +190,7 @@ class HocrTransform: pt = self.pt_from_pixel(pxl_coords) # draw the bbox border - if showBoundingboxes: + if showBoundingboxes: # pragma: no cover pdf.rect( pt.x1, self.height - pt.y2, pt.x2 - pt.x1, pt.y2 - pt.y1, fill=1 ) @@ -231,7 +231,7 @@ class HocrTransform: pdf.save() @classmethod - def polyval(cls, poly, x): + def polyval(cls, poly, x): # pragma: no cover return x * poly[0] + poly[1] def _do_line( @@ -269,7 +269,7 @@ class HocrTransform: # of the line box baseline_y2 = self.height - (line_box.y2 + intercept) - if showBoundingboxes: + if showBoundingboxes: # pragma: no cover # draw the baseline in magenta, dashed pdf.setDash() pdf.setStrokeColorRGB(0.95, 0.65, 0.95) @@ -318,7 +318,7 @@ class HocrTransform: font_width = pdf.stringWidth(elemtxt, fontname, fontsize) # draw the bbox border - if showBoundingboxes: + if showBoundingboxes: # pragma: no cover pdf.rect( box.x1, self.height - line_box.y2, box_width, line_height, fill=0 )