From a569a3fb57c664732c014c672838d3ddc819f184 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Mon, 18 Nov 2024 17:45:14 +0000 Subject: [PATCH] tests/: disable two long-running tests if running under valgrind. --- tests/test_general.py | 3 +++ tests/test_pixmap.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tests/test_general.py b/tests/test_general.py index 2f716f645..7a861ed49 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -1529,6 +1529,9 @@ def test_3450(): # # On a mac-mini, PyMuPDF-1.24.8 takes 60s, PyMuPDF-1.24.9 takes 4s. # + if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1': + print(f'test_3450(): not running on valgrind because very slow.', flush=1) + return path = os.path.normpath(f'{__file__}/../../tests/resources/test_3450.pdf') pdf = pymupdf.open(path) page = pdf[0] diff --git a/tests/test_pixmap.py b/tests/test_pixmap.py index 85093fee1..97e0c4319 100644 --- a/tests/test_pixmap.py +++ b/tests/test_pixmap.py @@ -367,6 +367,10 @@ def do(gi): def test_3848(): + if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1': + # Takes 40m on Github. + print(f'test_3848(): not running on valgrind because very slow.', flush=1) + return path = os.path.normpath(f'{__file__}/../../tests/resources/test_3848.pdf') with pymupdf.open(path) as document: for i in range(len(document)):