diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py index e6162997dd..abce235721 100644 --- a/synapse/events/__init__.py +++ b/synapse/events/__init__.py @@ -288,9 +288,6 @@ class EventBase(metaclass=abc.ABCMeta): return template_json - def __getitem__(self, field: str) -> Any | None: - return self._dict[field] - def __contains__(self, field: str) -> bool: return field in self._dict diff --git a/tests/handlers/test_federation.py b/tests/handlers/test_federation.py index 7085531548..e4a41cf1ae 100644 --- a/tests/handlers/test_federation.py +++ b/tests/handlers/test_federation.py @@ -19,7 +19,7 @@ # # import logging -from typing import Collection, cast +from typing import Collection from unittest import TestCase from unittest.mock import AsyncMock, Mock, patch @@ -140,7 +140,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase): "content": {}, "room_id": room_id, "sender": "@yetanotheruser:" + OTHER_SERVER, - "depth": cast(int, join_event["depth"]) + 1, + "depth": join_event.depth + 1, "prev_events": [join_event.event_id], "auth_events": [], "origin_server_ts": self.clock.time_msec(), @@ -192,7 +192,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase): "content": {}, "room_id": room_id, "sender": "@yetanotheruser:" + OTHER_SERVER, - "depth": cast(int, join_event["depth"]) + 1, + "depth": join_event.depth + 1, "prev_events": [join_event.event_id], "auth_events": [], "origin_server_ts": self.clock.time_msec(),