Skip to content

Commit

Permalink
TST: pypdf._utils.rename_kwargs (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Apr 16, 2023
1 parent fc32e24 commit dfa95bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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():
Expand Down

0 comments on commit dfa95bf

Please sign in to comment.