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

Commit

Permalink
Proper types for tests.module_api (#15031)
Browse files Browse the repository at this point in the history
* -> None for test methods

* A first batch of type fixes

* Introduce common parent test case

* Fixup that big test method

* tests.module_api passes mypy

* Changelog
  • Loading branch information
David Robertson committed Feb 9, 2023
1 parent 30509a1 commit 7081bb5
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 54 deletions.
1 change: 1 addition & 0 deletions changelog.d/15031.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve type hints.
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ exclude = (?x)
|synapse/storage/databases/main/cache.py
|synapse/storage/schema/

|tests/module_api/test_api.py
|tests/server.py
)$

Expand Down
10 changes: 7 additions & 3 deletions tests/events/test_presence_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@

from tests.handlers.test_sync import generate_sync_config
from tests.test_utils import simple_async_mock
from tests.unittest import FederatingHomeserverTestCase, override_config
from tests.unittest import (
FederatingHomeserverTestCase,
HomeserverTestCase,
override_config,
)


@attr.s
Expand Down Expand Up @@ -470,7 +474,7 @@ def send_local_online_presence_to_with_module_test_body(self) -> None:


def send_presence_update(
testcase: FederatingHomeserverTestCase,
testcase: HomeserverTestCase,
user_id: str,
access_token: str,
presence_state: str,
Expand All @@ -491,7 +495,7 @@ def send_presence_update(


def sync_presence(
testcase: FederatingHomeserverTestCase,
testcase: HomeserverTestCase,
user_id: str,
since_token: Optional[StreamToken] = None,
) -> Tuple[List[UserPresenceState], StreamToken]:
Expand Down

0 comments on commit 7081bb5

Please sign in to comment.