Skip to content

Conversation

@robinwatts
Copy link
Collaborator

No description provided.

assert (
wt
== "bogus font ascent/descent values (3117 / -2463)\n... repeated 2 times..."
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can simplify this to:

if pymupdf.mupdf_version_tuple < (1, 28):
    wt = pymupdf.TOOLS.mupdf_warnings()
    assert wt == "bogus font ascent/descent values (3117 / -2463)\n... repeated 2 times..."

Because:

  • We check that pymupdf.TOOLS.mupdf_warnings() returns empty string after every test.
  • The act of calling pymupdf.TOOLS.mupdf_warnings() clears the internal buffer, so later calls will always return empty string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants