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

Commit

Permalink
Add missing type hints to tests. (#14687)
Browse files Browse the repository at this point in the history
Adds type hints to tests.metrics and tests.crypto.
  • Loading branch information
clokep authored Dec 28, 2022
1 parent 2fb4071 commit a4ca770
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 64 deletions.
1 change: 1 addition & 0 deletions changelog.d/14687.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add missing type hints.
6 changes: 4 additions & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ exclude = (?x)
|tests/api/test_ratelimiting.py
|tests/app/test_openid_listener.py
|tests/appservice/test_scheduler.py
|tests/crypto/test_keyring.py
|tests/events/test_presence_router.py
|tests/events/test_utils.py
|tests/federation/test_federation_catch_up.py
Expand Down Expand Up @@ -90,13 +89,16 @@ disallow_untyped_defs = False
[mypy-tests.config.*]
disallow_untyped_defs = True

[mypy-tests.crypto.*]
disallow_untyped_defs = True

[mypy-tests.federation.transport.test_client]
disallow_untyped_defs = True

[mypy-tests.handlers.*]
disallow_untyped_defs = True

[mypy-tests.metrics.test_background_process_metrics]
[mypy-tests.metrics.*]
disallow_untyped_defs = True

[mypy-tests.push.test_bulk_push_rule_evaluator]
Expand Down
6 changes: 3 additions & 3 deletions tests/crypto/test_event_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@


class EventSigningTestCase(unittest.TestCase):
def setUp(self):
def setUp(self) -> None:
self.signing_key: SigningKey = decode_signing_key_base64(
KEY_ALG, KEY_VER, SIGNING_KEY_SEED
)

def test_sign_minimal(self):
def test_sign_minimal(self) -> None:
event_dict = {
"event_id": "$0:domain",
"origin": "domain",
Expand Down Expand Up @@ -69,7 +69,7 @@ def test_sign_minimal(self):
"aIbygsSdLOFzvdDjww8zUVKCmI02eP9xtyJxc/cLiBA",
)

def test_sign_message(self):
def test_sign_message(self) -> None:
event_dict = {
"content": {"body": "Here is the message content"},
"event_id": "$0:domain",
Expand Down
Loading

0 comments on commit a4ca770

Please sign in to comment.