diff --git a/tests/test_main.py b/tests/test_main.py index 11a4ce87..189335eb 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -13,6 +13,7 @@ import PyPDF2 as pypdf from ocrmypdf import ExitCode from ocrmypdf import leptonica from ocrmypdf.pdfa import file_claims_pdfa +import platform if sys.version_info.major < 3: @@ -34,6 +35,10 @@ def running_in_docker(): return os.path.exists('/.dockerinit') +def is_linux(): + return platform.system() == 'Linux' + + def setup_module(): with suppress(FileNotFoundError): shutil.rmtree(TEST_OUTPUT) @@ -199,6 +204,9 @@ def test_preserve_metadata(spoof_tesseract_noop, output_type): assert pdfa_info['output'] == output_type +@pytest.mark.skipif( + is_linux() and not running_in_docker(), + reason="likely to fail if Linux locale is not configured correctly") @pytest.mark.parametrize("output_type", [ 'pdfa', 'pdf' ])