From 30e4198f3a5f22cba9c91a73e2d960c0f8038553 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 1 Aug 2022 02:47:39 -0700 Subject: [PATCH] tests: fix test_validation when chi_sim not installed --- tests/test_validation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_validation.py b/tests/test_validation.py index 03473704..570370d7 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -42,16 +42,16 @@ def make_opts(*args, **kwargs): def test_hocr_notlatin_warning(caplog): - # Bypass the test to see if the language is installed; we just want to pretend - # that a non-Latin language is installed - vd.check_options( - *make_opts_pm(language='chi_sim', pdf_renderer='hocr', output_type='pdfa'), + vd.check_options_output( + make_opts_pm(language='chi_sim', pdf_renderer='hocr', output_type='pdfa')[0] ) assert 'PDF renderer is known to cause' in caplog.text def test_old_ghostscript(caplog): - with patch('ocrmypdf._exec.ghostscript.version', return_value='9.19'): + with patch('ocrmypdf._exec.ghostscript.version', return_value='9.19'), patch( + 'ocrmypdf._exec.tesseract.get_languages', return_value={'eng', 'chi_sim'} + ): vd.check_options(*make_opts_pm(language='chi_sim', output_type='pdfa')) assert 'does not work correctly' in caplog.text