Skip to content

Commit a750e69

Browse files
committed
Adapt pymupf test suite to upcoming MuPDF 1.26.9.
1 parent 01fbaed commit a750e69

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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, 9):
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: 4 additions & 4 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, 9):
343343
assert not wt
344344
else:
345345
assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 2 times...'
@@ -892,7 +892,7 @@ def test_4546():
892892
expected_mupdf_1_26_1 = b'JOB No.: Shipper (complete name and address) \xe5\x8f\x91\xe8\xb4\xa7\xe4\xba\xba(\xe5\x90\x8d\xe7\xa7\xb0\xe5\x8f\x8a\xe5\x9c\xb0\xe5\x9d\x80) Tel: Fax: \n \nS/O No. \xe6\x89\x98\xe8\xbf\x90\xe5\x8d\x95\xe5\x8f\xb7\xe7\xa0\x81 \nSINORICH TRANSPORT LIMITED \nSHIPPING ORDER \n\xe6\x89\x98\xe8\xbf\x90\xe5\x8d\x95 \n \xe5\xb8\x82\xe5\x9c\xba\xe9\x83\xa8: \n88570009 \n88577019 \n88'.decode()
893893

894894
# This output is different from either of the two expected strings.
895-
expected_mupdf_1_27_0 = b'JOB No.: \n \nS/O No. \xe6\x89\x98\xe8\xbf\x90\xe5\x8d\x95\xe5\x8f\xb7\xe7\xa0\x81 \nSINORICH TRANSPORT LIMITED \nSHIPPING ORDER \n\xe6\x89\x98\xe8\xbf\x90\xe5\x8d\x95 \n \xe5\xb8\x82\xe5\x9c\xba\xe9\x83\xa8: \n88570009 \n88577019 \n88572702 \n \xe6\x93\x8d\xe4\xbd\x9c\xe9\x83\xa8: \n88570008 \n88570004 \n \xe6\x96\x87\xe4\xbb\xb6\xe9\x83\xa8: \n88570003\n \nNotify Party(complete name and address, '.decode()
895+
expected_mupdf_1_26_9 = b'JOB No.: \n \nS/O No. \xe6\x89\x98\xe8\xbf\x90\xe5\x8d\x95\xe5\x8f\xb7\xe7\xa0\x81 \nSINORICH TRANSPORT LIMITED \nSHIPPING ORDER \n\xe6\x89\x98\xe8\xbf\x90\xe5\x8d\x95 \n \xe5\xb8\x82\xe5\x9c\xba\xe9\x83\xa8: \n88570009 \n88577019 \n88572702 \n \xe6\x93\x8d\xe4\xbd\x9c\xe9\x83\xa8: \n88570008 \n88570004 \n \xe6\x96\x87\xe4\xbb\xb6\xe9\x83\xa8: \n88570003\n \nNotify Party(complete name and address, '.decode()
896896

897897
print(f'expected_1_23_5\n{textwrap.indent(expected_1_23_5, " ")}')
898898
print(f'expected_mupdf_1_26_1\n{textwrap.indent(expected_mupdf_1_26_1, " ")}')
@@ -903,8 +903,8 @@ def test_4546():
903903
print(f'{text.encode()=}')
904904

905905
wt = pymupdf.TOOLS.mupdf_warnings()
906-
if pymupdf.mupdf_version_tuple >= (1, 27, 0):
907-
assert text == expected_mupdf_1_27_0
906+
if pymupdf.mupdf_version_tuple >= (1, 26, 9):
907+
assert text == expected_mupdf_1_26_9
908908
assert wt == 'Actualtext with no position. Text may be lost or mispositioned.\n... repeated 120 times...'
909909
elif pymupdf.mupdf_version_tuple >= (1, 26, 1):
910910
assert text == expected_mupdf_1_26_1

0 commit comments

Comments
 (0)