From 8376e31bd44556092cf7e38d8f1a3798df0ca67f Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Tue, 3 Dec 2024 14:53:27 +0000 Subject: [PATCH] tests/test_tesseract.py: avoid failure in sysinstall case. With sysinstall test, we install tesseract without 'eng' data. --- tests/test_tesseract.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_tesseract.py b/tests/test_tesseract.py index 7f208b7f4..dc61235d5 100644 --- a/tests/test_tesseract.py +++ b/tests/test_tesseract.py @@ -102,7 +102,12 @@ def test_3842(): partial_tp = page.get_textpage_ocr(flags=0, full=False) except Exception as e: print(f'test_3842(): received exception: {e}', flush=1) - assert 'No tessdata specified and Tesseract is not installed' in str(e) + if 'No tessdata specified and Tesseract is not installed' in str(e): + pass + elif 'Tesseract language initialisation failed' in str(e): + pass + else: + assert 0, f'Unexpected exception text: {str(e)=}' else: text = page.get_text(textpage=partial_tp) print()