Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix type hints in knocking tests #14887

Merged
merged 6 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14887.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add missing type hints.
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ exclude = (?x)
|tests/events/test_utils.py
|tests/federation/test_federation_catch_up.py
|tests/federation/test_federation_sender.py
|tests/federation/transport/test_knocking.py
|tests/handlers/test_typing.py
|tests/http/federation/test_matrix_federation_agent.py
|tests/http/federation/test_srv_resolver.py
Expand Down
6 changes: 3 additions & 3 deletions tests/federation/transport/test_knocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
from synapse.types import RoomAlias

from tests.test_utils import event_injection
from tests.unittest import FederatingHomeserverTestCase, TestCase
from tests.unittest import FederatingHomeserverTestCase, HomeserverTestCase


class KnockingStrippedStateEventHelperMixin(TestCase):
class KnockingStrippedStateEventHelperMixin(HomeserverTestCase):
def send_example_state_events_to_room(
self,
hs: "HomeServer",
Expand All @@ -49,7 +49,7 @@ def send_example_state_events_to_room(
# To set a canonical alias, we'll need to point an alias at the room first.
canonical_alias = "#fancy_alias:test"
self.get_success(
self.store.create_room_alias_association(
self.hs.get_datastores().main.create_room_alias_association(
RoomAlias.from_string(canonical_alias), room_id, ["test"]
)
)
Expand Down
4 changes: 1 addition & 3 deletions tests/rest/client/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,7 @@ def test_sync_backwards_typing(self) -> None:
self.make_request("GET", sync_url % (access_token, next_batch))


class SyncKnockTestCase(
unittest.HomeserverTestCase, KnockingStrippedStateEventHelperMixin
):
class SyncKnockTestCase(KnockingStrippedStateEventHelperMixin):
servlets = [
synapse.rest.admin.register_servlets,
login.register_servlets,
Expand Down