From c6b9a49cbb2188e8036e3ba01229459de41b1e57 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 10 Jun 2020 17:08:00 -0700 Subject: [PATCH] Fix tests that fail in CI --- tests/test_validation.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_validation.py b/tests/test_validation.py index d7955869..b905b594 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -49,16 +49,19 @@ def make_opts(*args, **kwargs): def test_hocr_notlatin_warning(caplog): - vd.check_options( - *make_opts_pm(language='chi_sim', pdf_renderer='hocr', output_type='pdfa') - ) + # Bypass the test to see if the language is installed; we just want to pretend + # that a non-Latin language is installed + with patch('ocrmypdf._validation.check_options_languages', return_value=None): + vd.check_options( + *make_opts_pm(language='chi_sim', pdf_renderer='hocr', output_type='pdfa') + ) 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'), patch( 'ocrmypdf._exec.tesseract.has_textonly_pdf', return_value=True - ): + ), patch('ocrmypdf._validation.check_options_languages', return_value=None): vd.check_options(*make_opts_pm(language='chi_sim', output_type='pdfa')) assert 'Ghostscript does not work correctly' in caplog.text