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

Commit 239124b

Browse files
committed
newsfile and lint
1 parent 342ebcb commit 239124b

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

changelog.d/12833.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add some type hints to tests files.

tests/crypto/test_event_signing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def setUp(self):
3939
# NB: `signedjson` expects `nacl.signing.SigningKey` instances which have been
4040
# monkeypatched to include new `alg` and `version` attributes. This is captured
4141
# by the `signedjson.types.SigningKey` protocol.
42-
self.signing_key: signedjson.types.SigningKey = nacl.signing.SigningKey(
42+
self.signing_key: signedjson.types.SigningKey = nacl.signing.SigningKey( # type: ignore[assignment]
4343
SIGNING_KEY_SEED
4444
)
4545
self.signing_key.alg = KEY_ALG

tests/http/test_servlet.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def test_parse_json_value(self):
6060
with self.assertRaises(SynapseError):
6161
parse_json_value_from_request(make_request(b""))
6262

63-
result3 = parse_json_value_from_request(make_request(b""), allow_empty_body=True)
63+
result3 = parse_json_value_from_request(
64+
make_request(b""), allow_empty_body=True
65+
)
6466
self.assertIsNone(result3)
6567

6668
# Invalid UTF-8.

tests/logging/test_opentracing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
try:
3535
import jaeger_client
3636
except ImportError:
37-
jaeger_client = None
37+
jaeger_client = None # type: ignore
3838

3939
from tests.unittest import TestCase
4040

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

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

0 commit comments

Comments
 (0)