Allow test_german to xfail if deu language is not installed
This commit is contained in:
@@ -100,6 +100,8 @@ def main():
|
||||
# Convert non-standard but supported -psm to --psm
|
||||
sys.argv = ['--psm' if arg == '-psm' else arg for arg in sys.argv]
|
||||
|
||||
if '_OCRMYPDF_TEST_INFILE' not in os.environ:
|
||||
real_tesseract() # test not properly set up
|
||||
source = os.environ['_OCRMYPDF_TEST_INFILE'] # required
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
+3
-4
@@ -349,10 +349,9 @@ def test_german(spoof_tesseract_cache, resources, outdir):
|
||||
sidecar,
|
||||
env=spoof_tesseract_cache,
|
||||
)
|
||||
print(os.environ)
|
||||
assert (
|
||||
p.returncode == ExitCode.ok
|
||||
), "This test may fail if Tesseract language packs are missing"
|
||||
if 'deu' not in tesseract.languages():
|
||||
pytest.xfail(reason="tesseract-deu language pack not installed")
|
||||
assert p.returncode == ExitCode.ok, "Requires tesseract deu language pack"
|
||||
|
||||
|
||||
def test_klingon(resources, outpdf):
|
||||
|
||||
Reference in New Issue
Block a user