mirror of
https://github.com/element-hq/synapse.git
synced 2026-06-04 10:21:26 +00:00
Use type hinting generics in standard collections (#19046)
aka PEP 585, added in Python 3.9 - https://peps.python.org/pep-0585/ - https://docs.astral.sh/ruff/rules/non-pep585-annotation/
This commit is contained in:
committed by
GitHub
parent
cba3a814c6
commit
fc244bb592
@@ -17,7 +17,7 @@
|
||||
# [This file includes modifications made by New Vector Limited]
|
||||
#
|
||||
#
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from typing import Any
|
||||
from unittest.mock import Mock
|
||||
|
||||
from parameterized import parameterized
|
||||
@@ -51,7 +51,7 @@ class HTTPPusherTests(HomeserverTestCase):
|
||||
hijack_auth = False
|
||||
|
||||
def make_homeserver(self, reactor: MemoryReactor, clock: Clock) -> HomeServer:
|
||||
self.push_attempts: List[Tuple[Deferred, str, dict]] = []
|
||||
self.push_attempts: list[tuple[Deferred, str, dict]] = []
|
||||
|
||||
m = Mock()
|
||||
|
||||
@@ -747,7 +747,7 @@ class HTTPPusherTests(HomeserverTestCase):
|
||||
|
||||
def _make_user_with_pusher(
|
||||
self, username: str, enabled: bool = True
|
||||
) -> Tuple[str, str]:
|
||||
) -> tuple[str, str]:
|
||||
"""Registers a user and creates a pusher for them.
|
||||
|
||||
Args:
|
||||
@@ -925,7 +925,7 @@ class HTTPPusherTests(HomeserverTestCase):
|
||||
ret = self.get_success(
|
||||
self.hs.get_datastores().main.get_pushers_by({"user_name": user_id})
|
||||
)
|
||||
pushers: List[PusherConfig] = list(ret)
|
||||
pushers: list[PusherConfig] = list(ret)
|
||||
|
||||
# Check that we still have one pusher, and that the device ID associated with
|
||||
# it didn't change.
|
||||
@@ -1118,7 +1118,7 @@ class HTTPPusherTests(HomeserverTestCase):
|
||||
device_id = user_tuple.device_id
|
||||
|
||||
# Set the push data dict based on test input parameters
|
||||
push_data: Dict[str, Any] = {
|
||||
push_data: dict[str, Any] = {
|
||||
"url": "http://example.com/_matrix/push/v1/notify",
|
||||
}
|
||||
if disable_badge_count:
|
||||
|
||||
Reference in New Issue
Block a user