Fix coverage settings and cover semfree

This commit is contained in:
James R. Barlow
2023-10-24 00:54:31 -07:00
parent b928dc0808
commit 990b462a94
3 changed files with 26 additions and 2 deletions
+2 -1
View File
@@ -105,7 +105,8 @@ exclude = '''
[tool.coverage.run]
branch = true
parallel = true
concurrency = ["multiprocessing"]
concurrency = ["multiprocessing", "thread"]
sigterm = true
[tool.coverage.paths]
source = ["src/ocrmypdf"]
+1 -1
View File
@@ -1159,7 +1159,7 @@ class PdfInfo:
return f"<PdfInfo('...'), page count={len(self)}>"
def main():
def main(): # pragma: no cover
"""Run as a script."""
import argparse # pylint: disable=import-outside-toplevel
from pprint import pprint # pylint: disable=import-outside-toplevel
+23
View File
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2023 James R. Barlow
# SPDX-License-Identifier: MPL-2.0
from __future__ import annotations
from ocrmypdf.exceptions import ExitCode
from .conftest import run_ocrmypdf_api
def test_semfree(resources, outpdf):
exitcode = run_ocrmypdf_api(
resources / 'multipage.pdf',
outpdf,
'--skip-text',
'--skip-big',
'2',
'--plugin',
'ocrmypdf.extra_plugins.semfree',
'--plugin',
'tests/plugins/tesseract_noop.py',
)
assert exitcode == ExitCode.ok