From 4fed4e2af334db2e86d6f14c4fbda1a18f467cbe Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Fri, 26 Aug 2016 15:08:56 -0700 Subject: [PATCH] tests: don't try to pass Unicode arguments on command line on Linux Depends on locale being configured properly, and it's not necessary to be able to do this. --- tests/test_main.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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' ])