Make test_german more Windows-friendly

This commit is contained in:
James R. Barlow
2019-12-04 21:01:09 -08:00
parent 66d04dd6e3
commit cff37bf681
+14 -12
View File
@@ -313,18 +313,20 @@ def test_german(spoof_tesseract_cache, resources, outdir):
# properly. It is fine that we are testing -l deu on a French file because
# we are exercising the functionality not going for accuracy.
sidecar = outdir / 'francais.txt'
result = run_ocrmypdf_api(
resources / 'francais.pdf',
outdir / 'francais.pdf',
'-l',
'deu', # more commonly installed
'--sidecar',
sidecar,
env=spoof_tesseract_cache,
)
if 'deu' not in tesseract.languages():
pytest.xfail(reason="tesseract-deu language pack not installed")
assert result == ExitCode.ok, "Requires tesseract deu language pack"
try:
check_ocrmypdf(
resources / 'francais.pdf',
outdir / 'francais.pdf',
'-l',
'deu', # more commonly installed
'--sidecar',
sidecar,
env=spoof_tesseract_cache,
)
except MissingDependencyError:
if 'deu' not in tesseract.languages():
pytest.xfail(reason="tesseract-deu language pack not installed")
raise
def test_klingon(resources, outpdf):