Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Mar 2, 2024
1 parent f5e1d1a commit 8033c82
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions py-polars/tests/unit/utils/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ def test_issue_deprecation_warning() -> None:

def test_deprecate_function() -> None:
@deprecate_function("This is deprecated.", version="1.0.0")
def hello() -> None: ...
def hello() -> None:
...

with pytest.deprecated_call():
hello()


def test_deprecate_renamed_function() -> None:
@deprecate_renamed_function("new_hello", version="1.0.0")
def hello() -> None: ...
def hello() -> None:
...

with pytest.deprecated_call(match="new_hello"):
hello()
Expand All @@ -38,7 +40,8 @@ def hello() -> None: ...
def test_deprecate_renamed_parameter(recwarn: Any) -> None:
@deprecate_renamed_parameter("foo", "oof", version="1.0.0")
@deprecate_renamed_parameter("bar", "rab", version="2.0.0")
def hello(oof: str, rab: str, ham: str) -> None: ...
def hello(oof: str, rab: str, ham: str) -> None:
...

hello(foo="x", bar="y", ham="z") # type: ignore[call-arg]

Expand All @@ -49,9 +52,8 @@ def hello(oof: str, rab: str, ham: str) -> None: ...

class Foo: # noqa: D101
@deprecate_nonkeyword_arguments(allowed_args=["self", "baz"], version="0.1.2")
def bar( # noqa: D102
self, baz: str, ham: str | None = None, foobar: str | None = None
) -> None: ...
def bar(self, baz: str, ham: str | None = None, foobar: str | None = None) -> None:
...


def test_deprecate_nonkeyword_arguments_method_signature() -> None:
Expand Down

0 comments on commit 8033c82

Please sign in to comment.