Skip to content

Commit 3dc63c3

Browse files
tests/: fixed some tests with current mupdf-1.28.x version 1.28.5.
Current 1.28.x fixes #5054, #5082, #5101.
1 parent cbd0d3b commit 3dc63c3

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎tests/test_general.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ def test_5054():
22792279
text2 = page.get_text()
22802280
print(f'{text1=}')
22812281
print(f'{text2=}')
2282-
if pymupdf.mupdf_version_tuple < (1, 29):
2282+
if pymupdf.mupdf_version_tuple <= (1, 28, 4):
22832283
assert text2 != text1
22842284
else:
22852285
assert text2 == text1

‎tests/test_pixmap.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,7 @@ def test_5082():
806806
except subprocess.TimeoutExpired:
807807
timeout = True
808808
print(f'test_5082(): {timeout=}')
809-
# As of 2026-08-18 we expect timeout with 1.28.x (currently 1.28.3) and
810-
# earlier.
811-
if pymupdf.mupdf_version_tuple <= (1, 28, 4):
809+
if pymupdf.mupdf_version_tuple < (1, 28, 5):
812810
assert timeout, f'Expected timeout from {pymupdf.mupdf_version=}.'
813811
else:
814812
assert not timeout, f'Unexpected timeout from {pymupdf.mupdf_version=}.'

‎tests/test_widgets.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,14 @@ def test_5101():
546546
path = os.path.normpath(f'{__file__}/../../tests/resources/test_5101.pdf')
547547
with pymupdf.open(path) as document:
548548
print(f'{len(document)=}')
549-
if pymupdf.mupdf_version_tuple >= (1, 29):
549+
if pymupdf.mupdf_version_tuple >= (1, 28, 5):
550550
page = document[0]
551551
wt = pymupdf.TOOLS.mupdf_warnings()
552552
print(f'{wt=}')
553-
assert wt == 'cycle in parent chain\nfixed bad Parent in AcroForm tree\n... repeated 2 times...'
553+
if pymupdf.mupdf_version_tuple >= (1, 29):
554+
assert wt == 'cycle in parent chain\nfixed bad Parent in AcroForm tree\n... repeated 2 times...'
555+
else:
556+
assert wt == 'fixed bad Parent in AcroForm tree\n... repeated 2 times...'
554557
document2 = pymupdf.open()
555558
document2.insert_pdf(document, annots=False, widgets=False, links=True)
556559
else:
@@ -657,4 +660,3 @@ def get_acro_names(document):
657660

658661
assert num_still_present == 0, f'{num_still_present=}'
659662
assert num_still_present_acro == 0, f'{num_still_present_acro=}'
660-

0 commit comments

Comments
 (0)