diff options
author | Jonathan de Jong <jonathan@automatia.nl> | 2021-07-13 12:52:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 11:52:58 +0100 |
commit | 93729719b8451493e1df9930feb9f02f14ea5cef (patch) | |
tree | 90f9608894f30f35c824427aa8b3657a41246bdd /tests/server.py | |
parent | [pyupgrade] `tests/` (#10347) (diff) | |
download | synapse-93729719b8451493e1df9930feb9f02f14ea5cef.tar.xz |
Use inline type hints in `tests/` (#10350)
This PR is tantamount to running: python3.8 -m com2ann -v 6 tests/ (com2ann requires python 3.8 to run)
Diffstat (limited to 'tests/server.py')
-rw-r--r-- | tests/server.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/server.py b/tests/server.py index f32d8dc375..6fddd3b305 100644 --- a/tests/server.py +++ b/tests/server.py @@ -52,7 +52,7 @@ class FakeChannel: _reactor = attr.ib() result = attr.ib(type=dict, default=attr.Factory(dict)) _ip = attr.ib(type=str, default="127.0.0.1") - _producer = None # type: Optional[Union[IPullProducer, IPushProducer]] + _producer: Optional[Union[IPullProducer, IPushProducer]] = None @property def json_body(self): @@ -316,8 +316,10 @@ class ThreadedMemoryReactorClock(MemoryReactorClock): self._tcp_callbacks = {} self._udp = [] - lookups = self.lookups = {} # type: Dict[str, str] - self._thread_callbacks = deque() # type: Deque[Callable[[], None]] + self.lookups: Dict[str, str] = {} + self._thread_callbacks: Deque[Callable[[], None]] = deque() + + lookups = self.lookups @implementer(IResolverSimple) class FakeResolver: |