Skip to content

Commit

Permalink
Actually show deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Jan 19, 2025
1 parent c2cf864 commit 31cfa76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/uharfbuzz/_harfbuzz.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def deprecated(replacement=None):
if replacement:
message += f", use {replacement} instead"
if message not in WARNED:
warnings.warn(message, DeprecationWarning, stacklevel=2)
warnings.warn(message, DeprecationWarning)
WARNED.add(message)
return func(*args, **kwargs)

Expand Down
5 changes: 5 additions & 0 deletions tests/test_uharfbuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1811,3 +1811,8 @@ def test_subset(blankfont):
assert len(reverse) == 5
cmap = plan.unicode_to_old_glyph_mapping
assert cmap[ord("b")] == 2


def test_deprecated():
with pytest.deprecated_call():
hb.ot_color_glyph_get_layers(hb.Face(), 0)

0 comments on commit 31cfa76

Please sign in to comment.