mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-23 10:53:31 +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:
1 parent
cba3a814c6
commit
fc244bb592
539 files changed
+4599
-5066
No files matched your search
@@ -19,7 +19,7 @@
|
||||
# [This file includes modifications made by New Vector Limited]
|
||||
#
|
||||
#
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Optional
|
||||
|
||||
from twisted.internet.testing import MemoryReactor
|
||||
from twisted.web.resource import Resource
|
||||
@@ -50,7 +50,7 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
|
||||
|
||||
self.url = "/_synapse/admin/v1/statistics/users/media"
|
||||
|
||||
def create_resource_dict(self) -> Dict[str, Resource]:
|
||||
def create_resource_dict(self) -> dict[str, Resource]:
|
||||
resources = super().create_resource_dict()
|
||||
resources["/_matrix/media"] = self.hs.get_media_repository_resource()
|
||||
return resources
|
||||
@@ -485,7 +485,7 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
|
||||
# Upload some media into the room
|
||||
self.helper.upload_media(SMALL_PNG, tok=user_token, expect_code=200)
|
||||
|
||||
def _check_fields(self, content: List[JsonDict]) -> None:
|
||||
def _check_fields(self, content: list[JsonDict]) -> None:
|
||||
"""Checks that all attributes are present in content
|
||||
Args:
|
||||
content: List that is checked for content
|
||||
@@ -497,7 +497,7 @@ class UserMediaStatisticsTestCase(unittest.HomeserverTestCase):
|
||||
self.assertIn("media_length", c)
|
||||
|
||||
def _order_test(
|
||||
self, order_type: str, expected_user_list: List[str], dir: Optional[str] = None
|
||||
self, order_type: str, expected_user_list: list[str], dir: Optional[str] = None
|
||||
) -> None:
|
||||
"""Request the list of users in a certain order. Assert that order is what
|
||||
we expect
|
||||
|
||||
Reference in new issue
Block a user