diff options
author | David Robertson <davidr@element.io> | 2022-08-21 23:28:48 +0100 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2022-08-21 23:28:48 +0100 |
commit | 9b6764b2efaf978e8a413e1aabe2aaf55e3f260e (patch) | |
tree | d9229523244f8ca0a3da67e2f9c7cff5b11fb1fc /tests/server.py | |
parent | Remove unused config.ldap_enabled (diff) | |
download | synapse-9b6764b2efaf978e8a413e1aabe2aaf55e3f260e.tar.xz |
A bit more paramspec
Diffstat (limited to 'tests/server.py')
-rw-r--r-- | tests/server.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/server.py b/tests/server.py index 0434d1a9c0..f719622fa1 100644 --- a/tests/server.py +++ b/tests/server.py @@ -100,6 +100,7 @@ logger = logging.getLogger(__name__) # the type of thing that can be passed into `make_request` in the headers list CustomHeaderType = Tuple[Union[str, bytes], Union[str, bytes]] P = ParamSpec("P") +R = TypeVar("R") class TimedOutException(Exception): @@ -559,7 +560,7 @@ def _make_test_homeserver_synchronous(server: HomeServer) -> None: for database in server.get_datastores().databases: pool = database._db_pool - def runWithConnection(func, *args, **kwargs): + def runWithConnection(func: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> "Deferred[R]": return threads.deferToThreadPool( pool._reactor, pool.threadpool, @@ -569,7 +570,7 @@ def _make_test_homeserver_synchronous(server: HomeServer) -> None: **kwargs, ) - def runInteraction(interaction, *args, **kwargs): + def runInteraction(interaction: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> "Deferred[R]": return threads.deferToThreadPool( pool._reactor, pool.threadpool, |