From 84dc5b38b3f033183ae15af9d9badddc0071aa3b Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 21 Sep 2025 23:45:26 +0100 Subject: [PATCH] tests/: update expectations after recent changes to mupdf-1.26.x. --- tests/test_tables.py | 2 +- tests/test_textextract.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_tables.py b/tests/test_tables.py index dd691fab7..d2f4c0967 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -184,7 +184,7 @@ def test_2979(): ), f"{pymupdf.TOOLS.set_small_glyph_heights()=}" wt = pymupdf.TOOLS.mupdf_warnings() - if pymupdf.mupdf_version_tuple >= (1, 27, 0): + if pymupdf.mupdf_version_tuple >= (1, 26, 8): assert ( wt == "bogus font ascent/descent values (3117 / -2463)\n... repeated 2 times...\nActualtext with no position. Text may be lost or mispositioned.\n... repeated 96 times..." diff --git a/tests/test_textextract.py b/tests/test_textextract.py index 154dd6f56..ddb118681 100644 --- a/tests/test_textextract.py +++ b/tests/test_textextract.py @@ -339,7 +339,7 @@ def test_3594(): print(f' {line!r}') print('='*40) wt = pymupdf.TOOLS.mupdf_warnings() - if pymupdf.mupdf_version_tuple < (1, 27): + if pymupdf.mupdf_version_tuple < (1, 26, 8): assert not wt else: assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 2 times...' @@ -387,12 +387,14 @@ def get_all_page_from_pdf(document, last_page=None): assert texts1 == texts0 wt = pymupdf.TOOLS.mupdf_warnings() - if pymupdf.mupdf_version_tuple < (1, 27): - assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 434 times...' - else: + if pymupdf.mupdf_version_tuple >= (1, 27): expected = 'format error: No common ancestor in structure tree\nstructure tree broken, assume tree is missing' expected = '\n'.join([expected] * 56) assert wt == expected + elif pymupdf.mupdf_version_tuple >= (1, 26, 8): + assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 7684 times...' + else: + assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 434 times...' def test_3650(): path = os.path.normpath(f'{__file__}/../../tests/resources/test_3650.pdf') @@ -903,7 +905,7 @@ def test_4546(): print(f'{text.encode()=}') wt = pymupdf.TOOLS.mupdf_warnings() - if pymupdf.mupdf_version_tuple >= (1, 27, 0): + if pymupdf.mupdf_version_tuple >= (1, 26, 8): assert text == expected_mupdf_1_27_0 assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 120 times...' elif pymupdf.mupdf_version_tuple >= (1, 26, 1):