Skip to content

Commit

Permalink
Tests: flake8-related cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison committed Mar 27, 2024
1 parent 2bbb850 commit be6d6e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

from pywisetransfer.deprecation import deprecated

record_warnings = lambda: catch_warnings(record=True)

def record_warnings():
return catch_warnings(record=True)


def undecorated(n):
Expand Down Expand Up @@ -34,8 +36,8 @@ def kwarg_decorator(n):
class Class:
base = 2

@deprecated(message="instance")
def instancemethod_decorator(self, n):
@deprecated(message="method")
def method_decorator(self, n):
return self.base + n + 3


Expand All @@ -47,7 +49,7 @@ def instancemethod_decorator(self, n):
(zero_args_decorator, "zero_args_decorator", True, 2, None),
(posarg_decorator, "posarg_decorator", True, 3, "positional"),
(kwarg_decorator, "kwarg_decorator", True, 4, "keyword"),
(Class().instancemethod_decorator, "instancemethod_decorator", True, 5, "instance"),
(Class().method_decorator, "method_decorator", True, 5, "method"),
],
)
def test_decorator_variants(func, name, deprecated, result, message):
Expand Down

0 comments on commit be6d6e6

Please sign in to comment.