Skip to content

Commit

Permalink
tests/test_annots.py: Fix test_parent() on OpenBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Nov 28, 2024
1 parent e70ade2 commit db6ba8d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_annots.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

import os
import platform

import pymupdf
import gentle_compare
Expand Down Expand Up @@ -451,8 +452,11 @@ def test_parent():
print(a) # should raise
except Exception as e:
if pymupdf.mupdf_version_tuple >= (1, 25):
assert isinstance(e, pymupdf.mupdf.FzErrorArgument)
assert str(e) == 'code=4: annotation not bound to any page'
if platform.system() == 'OpenBSD':
assert isinstance(e, pymupdf.mupdf.FzErrorBase), f'Incorrect {type(e)=}.'
else:
assert isinstance(e, pymupdf.mupdf.FzErrorArgument), f'Incorrect {type(e)=}.'
assert str(e) == 'code=4: annotation not bound to any page', f'Incorrect error text {str(e)=}.'
else:
assert isinstance(e, ReferenceError)
assert str(e) == 'weakly-referenced object no longer exists'
Expand Down

0 comments on commit db6ba8d

Please sign in to comment.