Skip to content

Commit 8dd3d11

Browse files
tests/: update expectations after recent changes to mupdf-1.26.x.
1 parent 01fbaed commit 8dd3d11

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tests/test_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_2979():
184184
), f"{pymupdf.TOOLS.set_small_glyph_heights()=}"
185185

186186
wt = pymupdf.TOOLS.mupdf_warnings()
187-
if pymupdf.mupdf_version_tuple >= (1, 27, 0):
187+
if pymupdf.mupdf_version_tuple >= (1, 26, 8):
188188
assert (
189189
wt
190190
== "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..."

tests/test_textextract.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_3594():
339339
print(f' {line!r}')
340340
print('='*40)
341341
wt = pymupdf.TOOLS.mupdf_warnings()
342-
if pymupdf.mupdf_version_tuple < (1, 27):
342+
if pymupdf.mupdf_version_tuple < (1, 26, 8):
343343
assert not wt
344344
else:
345345
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):
387387
assert texts1 == texts0
388388

389389
wt = pymupdf.TOOLS.mupdf_warnings()
390-
if pymupdf.mupdf_version_tuple < (1, 27):
391-
assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 434 times...'
392-
else:
390+
if pymupdf.mupdf_version_tuple >= (1, 27):
393391
expected = 'format error: No common ancestor in structure tree\nstructure tree broken, assume tree is missing'
394392
expected = '\n'.join([expected] * 56)
395393
assert wt == expected
394+
elif pymupdf.mupdf_version_tuple >= (1, 26, 8):
395+
assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 7684 times...'
396+
else:
397+
assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 434 times...'
396398

397399
def test_3650():
398400
path = os.path.normpath(f'{__file__}/../../tests/resources/test_3650.pdf')
@@ -903,7 +905,7 @@ def test_4546():
903905
print(f'{text.encode()=}')
904906

905907
wt = pymupdf.TOOLS.mupdf_warnings()
906-
if pymupdf.mupdf_version_tuple >= (1, 27, 0):
908+
if pymupdf.mupdf_version_tuple >= (1, 26, 8):
907909
assert text == expected_mupdf_1_27_0
908910
assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 120 times...'
909911
elif pymupdf.mupdf_version_tuple >= (1, 26, 1):

0 commit comments

Comments
 (0)