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

Commit a4ca770

Browse files
authored
Add missing type hints to tests. (#14687)
Adds type hints to tests.metrics and tests.crypto.
1 parent 2fb4071 commit a4ca770

File tree

5 files changed

+95
-64
lines changed

5 files changed

+95
-64
lines changed

changelog.d/14687.misc

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

mypy.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ exclude = (?x)
3636
|tests/api/test_ratelimiting.py
3737
|tests/app/test_openid_listener.py
3838
|tests/appservice/test_scheduler.py
39-
|tests/crypto/test_keyring.py
4039
|tests/events/test_presence_router.py
4140
|tests/events/test_utils.py
4241
|tests/federation/test_federation_catch_up.py
@@ -90,13 +89,16 @@ disallow_untyped_defs = False
9089
[mypy-tests.config.*]
9190
disallow_untyped_defs = True
9291

92+
[mypy-tests.crypto.*]
93+
disallow_untyped_defs = True
94+
9395
[mypy-tests.federation.transport.test_client]
9496
disallow_untyped_defs = True
9597

9698
[mypy-tests.handlers.*]
9799
disallow_untyped_defs = True
98100

99-
[mypy-tests.metrics.test_background_process_metrics]
101+
[mypy-tests.metrics.*]
100102
disallow_untyped_defs = True
101103

102104
[mypy-tests.push.test_bulk_push_rule_evaluator]

tests/crypto/test_event_signing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333

3434

3535
class EventSigningTestCase(unittest.TestCase):
36-
def setUp(self):
36+
def setUp(self) -> None:
3737
self.signing_key: SigningKey = decode_signing_key_base64(
3838
KEY_ALG, KEY_VER, SIGNING_KEY_SEED
3939
)
4040

41-
def test_sign_minimal(self):
41+
def test_sign_minimal(self) -> None:
4242
event_dict = {
4343
"event_id": "$0:domain",
4444
"origin": "domain",
@@ -69,7 +69,7 @@ def test_sign_minimal(self):
6969
"aIbygsSdLOFzvdDjww8zUVKCmI02eP9xtyJxc/cLiBA",
7070
)
7171

72-
def test_sign_message(self):
72+
def test_sign_message(self) -> None:
7373
event_dict = {
7474
"content": {"body": "Here is the message content"},
7575
"event_id": "$0:domain",

0 commit comments

Comments
 (0)