Remove oddball log.error/raise Exception() pattern

Instead present error message in exception.
This commit is contained in:
James R. Barlow
2023-08-12 01:02:42 -07:00
parent 72e056436c
commit 6e20439c91
2 changed files with 15 additions and 17 deletions
+4 -3
View File
@@ -19,10 +19,11 @@ def acroform(resources):
return resources / 'acroform.pdf'
def test_acroform_and_redo(acroform, caplog, no_outpdf):
with pytest.raises(ocrmypdf.exceptions.InputFileError):
def test_acroform_and_redo(acroform, no_outpdf):
with pytest.raises(
ocrmypdf.exceptions.InputFileError, match='--redo-ocr is not currently possible'
):
check_ocrmypdf(acroform, no_outpdf, '--redo-ocr')
assert '--redo-ocr is not currently possible' in caplog.text
def test_acroform_message(acroform, caplog, outpdf):