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

Commit 7081bb5

Browse files
author
David Robertson
authored
Proper types for tests.module_api (#15031)
* -> 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
1 parent 30509a1 commit 7081bb5

File tree

4 files changed

+80
-54
lines changed

4 files changed

+80
-54
lines changed

changelog.d/15031.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve type hints.

mypy.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ exclude = (?x)
3232
|synapse/storage/databases/main/cache.py
3333
|synapse/storage/schema/
3434

35-
|tests/module_api/test_api.py
3635
|tests/server.py
3736
)$
3837

tests/events/test_presence_router.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131

3232
from tests.handlers.test_sync import generate_sync_config
3333
from tests.test_utils import simple_async_mock
34-
from tests.unittest import FederatingHomeserverTestCase, override_config
34+
from tests.unittest import (
35+
FederatingHomeserverTestCase,
36+
HomeserverTestCase,
37+
override_config,
38+
)
3539

3640

3741
@attr.s
@@ -470,7 +474,7 @@ def send_local_online_presence_to_with_module_test_body(self) -> None:
470474

471475

472476
def send_presence_update(
473-
testcase: FederatingHomeserverTestCase,
477+
testcase: HomeserverTestCase,
474478
user_id: str,
475479
access_token: str,
476480
presence_state: str,
@@ -491,7 +495,7 @@ def send_presence_update(
491495

492496

493497
def sync_presence(
494-
testcase: FederatingHomeserverTestCase,
498+
testcase: HomeserverTestCase,
495499
user_id: str,
496500
since_token: Optional[StreamToken] = None,
497501
) -> Tuple[List[UserPresenceState], StreamToken]:

0 commit comments

Comments
 (0)