From d666fc02fab7421efb39a33800a83791f88bf9b2 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Tue, 5 Apr 2022 14:54:41 +0200 Subject: Add type hints to some tests files (#12371) --- tests/storage/test__base.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests/storage/test__base.py') diff --git a/tests/storage/test__base.py b/tests/storage/test__base.py index 4899cd5c36..366398e39d 100644 --- a/tests/storage/test__base.py +++ b/tests/storage/test__base.py @@ -14,12 +14,18 @@ # limitations under the License. import secrets +from typing import Any, Dict, Generator, List, Tuple + +from twisted.test.proto_helpers import MemoryReactor + +from synapse.server import HomeServer +from synapse.util import Clock from tests import unittest class UpsertManyTests(unittest.HomeserverTestCase): - def prepare(self, reactor, clock, hs): + def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None: self.storage = hs.get_datastores().main self.table_name = "table_" + secrets.token_hex(6) @@ -40,11 +46,13 @@ class UpsertManyTests(unittest.HomeserverTestCase): ) ) - def _dump_to_tuple(self, res): + def _dump_to_tuple( + self, res: List[Dict[str, Any]] + ) -> Generator[Tuple[int, str, str], None, None]: for i in res: yield (i["id"], i["username"], i["value"]) - def test_upsert_many(self): + def test_upsert_many(self) -> None: """ Upsert_many will perform the upsert operation across a batch of data. """ -- cgit 1.4.1