diff --git a/tests/test_utils.py b/tests/test_utils.py index 0675c1b74..38e0d3057 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -289,7 +289,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any: # type: ignore return decoration @deprecation_bookmark_nofail(old_param="new_param") - def foo(old_param: int = 1, baz: int = 2) -> None: + def foo(old_param: int = 1, baz: int = 2, new_param: int = 1) -> None: pass expected_msg = ( @@ -299,6 +299,12 @@ def foo(old_param: int = 1, baz: int = 2) -> None: with pytest.raises(TypeError, match=expected_msg): foo(old_param=12, new_param=13) + with pytest.warns( + DeprecationWarning, + match="old_param is deprecated as an argument. Use new_param instead", + ): + foo(old_param=12) + @pytest.mark.enable_socket() def test_escapedcode_followed_by_int():