From 2a09a668f6e67381ce91ba34decfd78a52606b26 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 7 Apr 2021 02:18:08 -0700 Subject: [PATCH] Delinting: unused args --- src/ocrmypdf/optimize.py | 5 +++++ tests/test_stdio.py | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ocrmypdf/optimize.py b/src/ocrmypdf/optimize.py index 038e454d..fce66464 100644 --- a/src/ocrmypdf/optimize.py +++ b/src/ocrmypdf/optimize.py @@ -65,6 +65,9 @@ def jpg_name(root: Path, xref: Xref) -> Path: def extract_image_filter( pike: Pdf, root: Path, image: Object, xref: Xref ) -> Optional[Tuple[PdfImage, Tuple[Name, Object]]]: + del pike # unused args + del root + if image.Subtype != Name.Image: return None if image.Length < 100: @@ -103,6 +106,8 @@ def extract_image_filter( def extract_image_jbig2( *, pike: pikepdf.Pdf, root: Path, image: Object, xref: Xref, options ) -> Optional[XrefExt]: + del options # unused arg + result = extract_image_filter(pike, root, image, xref) if result is None: return None diff --git a/tests/test_stdio.py b/tests/test_stdio.py index 2e43cff5..f5993704 100644 --- a/tests/test_stdio.py +++ b/tests/test_stdio.py @@ -30,8 +30,7 @@ def test_stdin(ocrmypdf_exec, resources, outpdf): '--plugin', 'tests/plugins/tesseract_noop.py', ] - p = run(p_args, stdout=PIPE, stderr=PIPE, stdin=input_stream) - assert p.returncode == ExitCode.ok + run(p_args, stdout=PIPE, stderr=PIPE, stdin=input_stream, check=True) def test_stdout(ocrmypdf_exec, resources, outpdf): @@ -49,8 +48,7 @@ def test_stdout(ocrmypdf_exec, resources, outpdf): '--plugin', 'tests/plugins/tesseract_noop.py', ] - p = run(p_args, stdout=output_stream, stderr=PIPE, stdin=DEVNULL) - assert p.returncode == ExitCode.ok + run(p_args, stdout=output_stream, stderr=PIPE, stdin=DEVNULL, check=True) assert check_pdf(output_file)