mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-02-15 08:42:25 -05:00
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.
This commit is contained in:
@@ -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'
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user