@@ -392,11 +392,15 @@ def test_2238():
392392 rebased = hasattr (pymupdf , 'mupdf' )
393393 if rebased :
394394 wt = pymupdf .TOOLS .mupdf_warnings ()
395- assert wt == (
396- 'format error: cannot recognize version marker\n '
397- 'trying to repair broken xref\n '
398- 'repairing PDF document'
399- ), f'{ wt = } '
395+ wt_expected = ''
396+ if pymupdf .mupdf_version_tuple >= (1 , 26 ):
397+ wt_expected += 'garbage bytes before version marker\n '
398+ wt_expected += 'syntax error: expected \' obj\' keyword (6 0 ?)\n '
399+ else :
400+ wt_expected += 'format error: cannot recognize version marker\n '
401+ wt_expected += 'trying to repair broken xref\n '
402+ wt_expected += 'repairing PDF document'
403+ assert wt == wt_expected , f'{ wt = } '
400404 first_page = doc .load_page (0 ).get_text ('text' , pymupdf .INFINITE_RECT ())
401405 last_page = doc .load_page (- 1 ).get_text ('text' , pymupdf .INFINITE_RECT ())
402406
@@ -1555,7 +1559,10 @@ def test_3905():
15551559 else :
15561560 assert 0
15571561 wt = pymupdf .TOOLS .mupdf_warnings ()
1558- assert wt == 'format error: cannot recognize version marker\n trying to repair broken xref\n repairing PDF document'
1562+ if pymupdf .mupdf_version_tuple >= (1 , 26 ):
1563+ assert wt == 'format error: cannot find version marker\n trying to repair broken xref\n repairing PDF document'
1564+ else :
1565+ assert wt == 'format error: cannot recognize version marker\n trying to repair broken xref\n repairing PDF document'
15591566
15601567def test_3624 ():
15611568 path = os .path .normpath (f'{ __file__ } /../../tests/resources/test_3624.pdf' )
0 commit comments