Skip to content

Commit

Permalink
tests/: added test_3450().
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Sep 2, 2024
1 parent 5217275 commit bb5a456
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file added tests/resources/test_3450.pdf
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pathlib
import pickle
import platform
import time

scriptdir = os.path.abspath(os.path.dirname(__file__))
filename = os.path.join(scriptdir, "resources", "001003ED.pdf")
Expand Down Expand Up @@ -1311,3 +1312,18 @@ def test_3569():
)
wt = pymupdf.TOOLS.mupdf_warnings()
assert wt == 'unknown cid collection: PDFAUTOCAD-Indentity0\nnon-embedded font using identity encoding: ArialMT (mapping via )\ninvalid marked content and clip nesting'

def test_3450():
# This issue is a slow-down, so we just show time taken - it's not safe
# to fail if test takes too long because that can give spurious failures
# depending on hardware etc.
#
# On a mac-mini, PyMuPDF-1.24.8 takes 60s, PyMuPDF-1.24.9 takes 4s.
#
path = os.path.normpath(f'{__file__}/../../tests/resources/test_3450.pdf')
pdf = pymupdf.open(path)
page = pdf[0]
t = time.time()
pix = page.get_pixmap(alpha=False, dpi=150)
t = time.time() - t
print(f'test_3450(): {t=}')

0 comments on commit bb5a456

Please sign in to comment.