We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bde7cd9 commit ed47edcCopy full SHA for ed47edc
1 file changed
tests/test_annots.py
@@ -257,11 +257,13 @@ def test_1645():
257
)
258
doc.save(path_out, garbage=1, deflate=True, no_new_id=True)
259
print(f'Have created {path_out}. comparing with {path_expected}.')
260
- with open( path_out, 'rb') as f:
261
- out = f.read()
262
- with open( path_expected, 'rb') as f:
263
- expected = f.read()
264
- assert out == expected, f'Files differ: {path_out} {path_expected}'
+ with pymupdf.open(path_expected) as doc_expected, pymupdf.open(path_out) as doc_out:
+ rms = gentle_compare.pixmaps_rms(
+ doc_expected[0].get_pixmap(),
+ doc_out[0].get_pixmap(),
+ )
265
+ print(f'test_1645: {rms=}')
266
+ assert rms < 0.1, f'Pixmaps differ: {path_expected=} {path_out=}'
267
finally:
268
# Restore annot_stem.
269
pymupdf.TOOLS.set_annot_stem(annot_stem)
0 commit comments