From dfa92625680de66ad53632683cc80d72a48d07e3 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Tue, 15 Sep 2026 17:43:38 +0100 Subject: [PATCH 1/2] tests/test_general.py:test_3569(): fix failure with mupdf master. Mupdf warning text has changed on mupdf master. --- tests/test_general.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_general.py b/tests/test_general.py index fcbe99506..5a82a581b 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -1720,7 +1720,9 @@ def test_3569(): '\n' ) wt = pymupdf.TOOLS.mupdf_warnings() - if pymupdf.mupdf_version_tuple >= (1, 28): + if pymupdf.mupdf_version_tuple >= (1, 29): + assert wt == 'unknown cid collection: PDFAUTOCAD-Indentity0\nnon-embedded font using identity encoding: ArialMT (mapping via Adobe-Identity-UCS)\ninvalid marked content sequence / clip nesting' + elif pymupdf.mupdf_version_tuple >= (1, 28): assert wt == 'unknown cid collection: PDFAUTOCAD-Indentity0\nnon-embedded font using identity encoding: ArialMT (mapping via )\ninvalid marked content sequence / clip nesting' else: assert wt == 'unknown cid collection: PDFAUTOCAD-Indentity0\nnon-embedded font using identity encoding: ArialMT (mapping via )\ninvalid marked content and clip nesting' From e69ababd4a8dc7b5479bbe00f1ab387fd3ff42f1 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Tue, 15 Sep 2026 12:09:15 +0100 Subject: [PATCH 2/2] tests/: fixed some tests with current mupdf-1.28.x --- tests/test_general.py | 2 +- tests/test_pixmap.py | 4 +--- tests/test_widgets.py | 8 +++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_general.py b/tests/test_general.py index 5a82a581b..6c3bea9eb 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -2279,7 +2279,7 @@ def test_5054(): text2 = page.get_text() print(f'{text1=}') print(f'{text2=}') - if pymupdf.mupdf_version_tuple < (1, 29): + if pymupdf.mupdf_version_tuple < (1, 28, 6): assert text2 != text1 else: assert text2 == text1 diff --git a/tests/test_pixmap.py b/tests/test_pixmap.py index a699f3aa8..61ee3a68d 100644 --- a/tests/test_pixmap.py +++ b/tests/test_pixmap.py @@ -806,9 +806,7 @@ def test_5082(): except subprocess.TimeoutExpired: timeout = True print(f'test_5082(): {timeout=}') - # As of 2026-08-18 we expect timeout with 1.28.x (currently 1.28.3) and - # earlier. - if pymupdf.mupdf_version_tuple <= (1, 28, 4): + if pymupdf.mupdf_version_tuple < (1, 28, 6): assert timeout, f'Expected timeout from {pymupdf.mupdf_version=}.' else: assert not timeout, f'Unexpected timeout from {pymupdf.mupdf_version=}.' diff --git a/tests/test_widgets.py b/tests/test_widgets.py index 2408c1fa0..a36fbf8be 100644 --- a/tests/test_widgets.py +++ b/tests/test_widgets.py @@ -546,11 +546,14 @@ def test_5101(): path = os.path.normpath(f'{__file__}/../../tests/resources/test_5101.pdf') with pymupdf.open(path) as document: print(f'{len(document)=}') - if pymupdf.mupdf_version_tuple >= (1, 29): + if pymupdf.mupdf_version_tuple >= (1, 28, 6): page = document[0] wt = pymupdf.TOOLS.mupdf_warnings() print(f'{wt=}') - assert wt == 'cycle in parent chain\nfixed bad Parent in AcroForm tree\n... repeated 2 times...' + if pymupdf.mupdf_version_tuple >= (1, 29): + assert wt == 'cycle in parent chain\nfixed bad Parent in AcroForm tree\n... repeated 2 times...' + else: + assert wt == 'fixed bad Parent in AcroForm tree\n... repeated 2 times...' document2 = pymupdf.open() document2.insert_pdf(document, annots=False, widgets=False, links=True) else: @@ -657,4 +660,3 @@ def get_acro_names(document): assert num_still_present == 0, f'{num_still_present=}' assert num_still_present_acro == 0, f'{num_still_present_acro=}' -