summary refs log tree commit diff
path: root/tests/storage/test__base.py
diff options
context:
space:
mode:
authorDirk Klimpel <5740567+dklimpel@users.noreply.github.com>2022-04-05 14:54:41 +0200
committerGitHub <noreply@github.com>2022-04-05 13:54:41 +0100
commitd666fc02fab7421efb39a33800a83791f88bf9b2 (patch)
tree4313e8c64e6daa20ac471881b117d081fb0c9bbb /tests/storage/test__base.py
parentFix a spec compliance issue where requests to the `/publicRooms` federation A... (diff)
downloadsynapse-d666fc02fab7421efb39a33800a83791f88bf9b2.tar.xz
Add type hints to some tests files (#12371)
Diffstat (limited to 'tests/storage/test__base.py')
-rw-r--r--tests/storage/test__base.py14
1 files changed, 11 insertions, 3 deletions
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.
         """