@@ -399,24 +399,17 @@ def test_2108():
399399 print (f'' )
400400
401401 print (f'{ pymupdf .mupdf_version_tuple = } ' )
402- if pymupdf .mupdf_version_tuple >= (1 , 21 , 2 ):
403- print ('Asserting text==text_expected' )
404- assert text == text_expected
405- else :
406- print ('Asserting text!=text_expected' )
407- assert text != text_expected
402+ print ('Asserting text==text_expected' )
403+ assert text == text_expected
408404
409405
410406def test_2238 ():
411407 filepath = f'{ scriptdir } /resources/test2238.pdf'
412408 doc = pymupdf .open (filepath )
413409 wt = pymupdf .TOOLS .mupdf_warnings ()
414410 wt_expected = ''
415- if pymupdf .mupdf_version_tuple >= (1 , 26 ):
416- wt_expected += 'garbage bytes before version marker\n '
417- wt_expected += 'syntax error: expected \' obj\' keyword (6 0 ?)\n '
418- else :
419- wt_expected += 'format error: cannot recognize version marker\n '
411+ wt_expected += 'garbage bytes before version marker\n '
412+ wt_expected += 'syntax error: expected \' obj\' keyword (6 0 ?)\n '
420413 wt_expected += 'trying to repair broken xref\n '
421414 wt_expected += 'repairing PDF document'
422415 assert wt == wt_expected , f'{ wt = } '
@@ -1606,18 +1599,17 @@ def dict_set_path(dict_, *items):
16061599 with open (path_out , 'w' ) as f :
16071600 json .dump (results , f , indent = 4 , sort_keys = 1 )
16081601
1609- if pymupdf .mupdf_version_tuple >= (1 , 26 ):
1610- with open (os .path .normpath (f'{ __file__ } /../../tests/resources/test_open2_expected.json' )) as f :
1611- results_expected = json .load (f )
1612- if results != results_expected :
1613- print (f'results != results_expected:' )
1614- def show (r , name ):
1615- text = json .dumps (r , indent = 4 , sort_keys = 1 )
1616- print (f'{ name } :' )
1617- print (textwrap .indent (text , ' ' ))
1618- show (results_expected , 'results_expected' )
1619- show (results , 'results' )
1620- assert 0
1602+ with open (os .path .normpath (f'{ __file__ } /../../tests/resources/test_open2_expected.json' )) as f :
1603+ results_expected = json .load (f )
1604+ if results != results_expected :
1605+ print (f'results != results_expected:' )
1606+ def show (r , name ):
1607+ text = json .dumps (r , indent = 4 , sort_keys = 1 )
1608+ print (f'{ name } :' )
1609+ print (textwrap .indent (text , ' ' ))
1610+ show (results_expected , 'results_expected' )
1611+ show (results , 'results' )
1612+ assert 0
16211613
16221614
16231615def test_533 ():
@@ -1773,10 +1765,7 @@ def test_3905():
17731765 else :
17741766 assert 0
17751767 wt = pymupdf .TOOLS .mupdf_warnings ()
1776- if pymupdf .mupdf_version_tuple >= (1 , 26 ):
1777- assert wt == 'format error: cannot find version marker\n trying to repair broken xref\n repairing PDF document'
1778- else :
1779- assert wt == 'format error: cannot recognize version marker\n trying to repair broken xref\n repairing PDF document'
1768+ assert wt == 'format error: cannot find version marker\n trying to repair broken xref\n repairing PDF document'
17801769
17811770def test_3624 ():
17821771 path = os .path .normpath (f'{ __file__ } /../../tests/resources/test_3624.pdf' )
@@ -1822,10 +1811,7 @@ def test_4034():
18221811 pixmap2 = document [0 ].get_pixmap ()
18231812 rms = gentle_compare .pixmaps_rms (pixmap1 , pixmap2 )
18241813 print (f'test_4034(): Comparison of original/cleaned page 0 pixmaps: { rms = } .' )
1825- if pymupdf .mupdf_version_tuple < (1 , 25 , 2 ):
1826- assert 30 < rms < 50
1827- else :
1828- assert rms == 0
1814+ assert rms == 0
18291815
18301816def test_4309 ():
18311817 document = pymupdf .open ()
@@ -1842,11 +1828,8 @@ def test_4263():
18421828 command = f'pymupdf clean -linear { path } { path_out } '
18431829 print (f'Running: { command } ' )
18441830 cp = subprocess .run (command , shell = 1 , check = 0 )
1845- if pymupdf .mupdf_version_tuple < (1 , 26 ):
1846- assert cp .returncode == 0
1847- else :
1848- # Support for linerarisation dropped in MuPDF-1.26.
1849- assert cp .returncode
1831+ # Support for linerarisation dropped in MuPDF-1.26.
1832+ assert cp .returncode
18501833
18511834def test_4224 ():
18521835 path = os .path .normpath (f'{ __file__ } /../../tests/resources/test_4224.pdf' )
@@ -1856,9 +1839,6 @@ def test_4224():
18561839 path_pixmap = f'{ path } .{ page .number } .png'
18571840 pixmap .save (path_pixmap )
18581841 print (f'Have created: { path_pixmap } ' )
1859- if pymupdf .mupdf_version_tuple < (1 , 25 , 5 ):
1860- wt = pymupdf .TOOLS .mupdf_warnings ()
1861- assert wt == 'format error: negative code in 1d faxd\n padding truncated image'
18621842
18631843def test_4319 ():
18641844 # Have not seen this test reproduce issue #4319, but keeping it anyway.
0 commit comments