Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add missing type hints for tests.unittest. #13397

Merged
merged 11 commits into from
Jul 27, 2022
6 changes: 3 additions & 3 deletions tests/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import canonicaljson
import signedjson.key
import unpaddedbase64
from typing_extensions import ParamSpec, Protocol
from typing_extensions import Concatenate, ParamSpec, Protocol

from twisted.internet.defer import Deferred, ensureDeferred
from twisted.python.failure import Failure
Expand Down Expand Up @@ -101,7 +101,7 @@ def value(self) -> _ExcType:
...


def around(target: TV) -> Callable[[Callable[P, R]], None]:
def around(target: TV) -> Callable[[Callable[Concatenate[TV, P], R]], None]:
"""A CLOS-style 'around' modifier, which wraps the original method of the
given instance with another piece of code.

Expand All @@ -110,7 +110,7 @@ def method_name(orig, *args, **kwargs):
return orig(*args, **kwargs)
"""

def _around(code: Callable[P, R]) -> None:
def _around(code: Callable[Concatenate[TV, P], R]) -> None:
name = code.__name__
orig = getattr(target, name)

clokep marked this conversation as resolved.
Show resolved Hide resolved
Expand Down