diff options
author | David Robertson <davidr@element.io> | 2023-08-24 15:53:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-24 14:53:07 +0000 |
commit | e691243e191d9dad2bcbf55f9659d007f75fd28e (patch) | |
tree | 91db17d2145140077779b4532094b6a464479ba3 /tests/util/test_async_helpers.py | |
parent | Add `Retry-After` to M_LIMIT_EXCEEDED error responses (#16136) (diff) | |
download | synapse-e691243e191d9dad2bcbf55f9659d007f75fd28e.tar.xz |
Fix typechecking with twisted trunk (#16121)
Diffstat (limited to '')
-rw-r--r-- | tests/util/test_async_helpers.py | 14 |
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!") |