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

Commit

Permalink
newsfile and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed May 22, 2022
1 parent 342ebcb commit 239124b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/12833.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some type hints to tests files.
2 changes: 1 addition & 1 deletion tests/crypto/test_event_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def setUp(self):
# NB: `signedjson` expects `nacl.signing.SigningKey` instances which have been
# monkeypatched to include new `alg` and `version` attributes. This is captured
# by the `signedjson.types.SigningKey` protocol.
self.signing_key: signedjson.types.SigningKey = nacl.signing.SigningKey(
self.signing_key: signedjson.types.SigningKey = nacl.signing.SigningKey( # type: ignore[assignment]
SIGNING_KEY_SEED
)
self.signing_key.alg = KEY_ALG
Expand Down
4 changes: 3 additions & 1 deletion tests/http/test_servlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def test_parse_json_value(self):
with self.assertRaises(SynapseError):
parse_json_value_from_request(make_request(b""))

result3 = parse_json_value_from_request(make_request(b""), allow_empty_body=True)
result3 = parse_json_value_from_request(
make_request(b""), allow_empty_body=True
)
self.assertIsNone(result3)

# Invalid UTF-8.
Expand Down
4 changes: 2 additions & 2 deletions tests/logging/test_opentracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
try:
import jaeger_client
except ImportError:
jaeger_client = None
jaeger_client = None # type: ignore

from tests.unittest import TestCase

Expand All @@ -43,7 +43,7 @@ class LogContextScopeManagerTestCase(TestCase):
if LogContextScopeManager is None:
skip = "Requires opentracing" # type: ignore[unreachable]
if jaeger_client is None:
skip = "Requires jaeger_client"
skip = "Requires jaeger_client" # type: ignore[unreachable]

def setUp(self) -> None:
# since this is a unit test, we don't really want to mess around with the
Expand Down

0 comments on commit 239124b

Please sign in to comment.