Skip to content

Commit

Permalink
test: add test for deprecated_warn
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Jul 3, 2024
1 parent 08f5408 commit bf32c14
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/utils/test_deprecation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import pytest

from altair.utils.deprecation import AltairDeprecationWarning, deprecated
import re
from altair.utils.deprecation import (
AltairDeprecationWarning,
deprecated,
deprecated_warn,
)


def test_deprecated_class():
Expand All @@ -24,3 +28,11 @@ def func(x):
):
y = func(1)
assert y == 2


def test_deprecation_warn():
with pytest.warns(
AltairDeprecationWarning,
match=re.compile(r"altair=3321.+this code path is a noop", flags=re.DOTALL),
):
deprecated_warn("this code path is a noop", version="3321", stacklevel=1)

0 comments on commit bf32c14

Please sign in to comment.