Skip to content

Commit

Permalink
tests/: update test_4079 for progression in latest mupdf.
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Feb 10, 2025
1 parent f5d0ea2 commit 8a946b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Binary file modified tests/resources/test_4079_after.pdf
Binary file not shown.
Binary file added tests/resources/test_4079_after_1.25.pdf
Binary file not shown.
8 changes: 7 additions & 1 deletion tests/test_annots.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,10 @@ def test_4047():

def test_4079():
path = os.path.normpath(f'{__file__}/../../tests/resources/test_4079.pdf')
path_after = os.path.normpath(f'{__file__}/../../tests/resources/test_4079_after.pdf')
if pymupdf.mupdf_version_tuple >= (1, 26):
path_after = os.path.normpath(f'{__file__}/../../tests/resources/test_4079_after.pdf')
else:path_after = os.path.normpath(f'{__file__}/../../tests/resources/test_4079_after_1.25.pdf')

path_out = os.path.normpath(f'{__file__}/../../tests/test_4079_out')
with pymupdf.open(path_after) as document_after:
page = document_after[0]
Expand All @@ -500,6 +503,9 @@ def test_4079():
pixmap_after = page.get_pixmap()
document.save(f'{path_out}_after.pdf')
rms = gentle_compare.pixmaps_rms(pixmap_after_expected, pixmap_after)
diff = gentle_compare.pixmaps_diff(pixmap_after_expected, pixmap_after)
path = os.path.normpath(f'{__file__}/../../tests/test_4079_diff.png')
diff.save(path)
print(f'{rms=}')
# 2024-11-27 Expect current broken behaviour.
assert rms == 0
Expand Down

0 comments on commit 8a946b8

Please sign in to comment.