summary refs log tree commit diff
path: root/tests/util
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2023-08-24 15:53:07 +0100
committerGitHub <noreply@github.com>2023-08-24 14:53:07 +0000
commite691243e191d9dad2bcbf55f9659d007f75fd28e (patch)
tree91db17d2145140077779b4532094b6a464479ba3 /tests/util
parentAdd `Retry-After` to M_LIMIT_EXCEEDED error responses (#16136) (diff)
downloadsynapse-e691243e191d9dad2bcbf55f9659d007f75fd28e.tar.xz
Fix typechecking with twisted trunk (#16121)
Diffstat (limited to 'tests/util')
-rw-r--r--tests/util/test_async_helpers.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/util/test_async_helpers.py b/tests/util/test_async_helpers.py
index 91cac9822a..05983ed434 100644
--- a/tests/util/test_async_helpers.py
+++ b/tests/util/test_async_helpers.py
@@ -60,11 +60,9 @@ class ObservableDeferredTest(TestCase):
         observer1.addBoth(check_called_first)
 
         # store the results
-        results: List[Optional[ObservableDeferred[int]]] = [None, None]
+        results: List[Optional[int]] = [None, None]
 
-        def check_val(
-            res: ObservableDeferred[int], idx: int
-        ) -> ObservableDeferred[int]:
+        def check_val(res: int, idx: int) -> int:
             results[idx] = res
             return res
 
@@ -93,14 +91,14 @@ class ObservableDeferredTest(TestCase):
         observer1.addBoth(check_called_first)
 
         # store the results
-        results: List[Optional[ObservableDeferred[str]]] = [None, None]
+        results: List[Optional[Failure]] = [None, None]
 
-        def check_val(res: ObservableDeferred[str], idx: int) -> None:
+        def check_failure(res: Failure, idx: int) -> None:
             results[idx] = res
             return None
 
-        observer1.addErrback(check_val, 0)
-        observer2.addErrback(check_val, 1)
+        observer1.addErrback(check_failure, 0)
+        observer2.addErrback(check_failure, 1)
 
         try:
             raise Exception("gah!")