diff --git a/tests/test_main.py b/tests/test_main.py index 1d1e21ec..9d95a189 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -21,6 +21,7 @@ import os import shutil import resource import pytest +import sys from ocrmypdf.pdfinfo import PdfInfo, Colorspace, Encoding import PyPDF2 as pypdf from ocrmypdf.exceptions import ExitCode @@ -552,7 +553,7 @@ def test_algo4(resources, no_outpdf): @pytest.mark.parametrize('renderer', [ - 'hocr']) # tesseract cannot pass this test - resamples to square image + 'hocr', 'sandwich']) # tesseract cannot pass this test - resamples to square image def test_non_square_resolution(renderer, spoof_tesseract_cache, resources, outpdf): # Confirm input image is non-square resolution @@ -656,6 +657,8 @@ def test_stdout(spoof_tesseract_noop, ocrmypdf_exec, resources, outpdf): assert qpdf.check(output_file, log=None) +@pytest.mark.skipif(sys.version_info[0:3] >= (3, 6, 4), + reason="issue fixed in Python 3.6.4") def test_closed_streams(spoof_tesseract_noop, ocrmypdf_exec, resources, outpdf): input_file = str(resources / 'francais.pdf') output_file = str(outpdf) diff --git a/tests/test_unpaper.py b/tests/test_unpaper.py index 1d3d19ce..3e6357a0 100644 --- a/tests/test_unpaper.py +++ b/tests/test_unpaper.py @@ -15,22 +15,9 @@ # You should have received a copy of the GNU General Public License # along with OCRmyPDF. If not, see . -from subprocess import Popen, PIPE, check_output, check_call, DEVNULL from pathlib import Path -import os -import shutil -import resource import pytest -from ocrmypdf.pdfinfo import PdfInfo, Colorspace, Encoding -import PyPDF2 as pypdf from ocrmypdf.exceptions import ExitCode -from ocrmypdf import leptonica -from ocrmypdf.pdfa import file_claims_pdfa -from ocrmypdf.exec import ghostscript, tesseract, qpdf -import logging -from math import isclose - -import PIL # pytest.helpers is dynamic # pylint: disable=no-member @@ -46,7 +33,7 @@ spoof = pytest.helpers.spoof def test_no_unpaper(resources, no_outpdf): # p, out, err = run_ocrmypdf( - resources / 'c02-22.pdf', no_outpdf, '--clean', env=env) + resources / 'c02-22.pdf', no_outpdf, '--clean', env=os.environ) assert p.returncode == ExitCode.missing_dependency