summary refs log tree commit diff
path: root/tests/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-10-30 12:08:09 +0000
committerErik Johnston <erik@matrix.org>2020-10-30 12:08:09 +0000
commit1ff3bc332ac5bd7a3c9ac4fcbcbf1692111f33d1 (patch)
tree9abed3402979f5105af3cb7ef739e8646e13f148 /tests/server.py
parentMerge branch 'develop' into matrix-org-hotfixes (diff)
parentImplement and use an @lru_cache decorator (#8595) (diff)
downloadsynapse-1ff3bc332ac5bd7a3c9ac4fcbcbf1692111f33d1.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/server.py')
-rw-r--r--tests/server.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/server.py b/tests/server.py

index 4d33b84097..3dd2cfc072 100644 --- a/tests/server.py +++ b/tests/server.py
@@ -46,7 +46,7 @@ class FakeChannel: site = attr.ib(type=Site) _reactor = attr.ib() - result = attr.ib(default=attr.Factory(dict)) + result = attr.ib(type=dict, default=attr.Factory(dict)) _producer = None @property @@ -380,7 +380,7 @@ def setup_test_homeserver(cleanup_func, *args, **kwargs): pool._runWithConnection, func, *args, - **kwargs + **kwargs, ) def runInteraction(interaction, *args, **kwargs): @@ -390,7 +390,7 @@ def setup_test_homeserver(cleanup_func, *args, **kwargs): pool._runInteraction, interaction, *args, - **kwargs + **kwargs, ) pool.runWithConnection = runWithConnection @@ -571,12 +571,10 @@ def connect_client(reactor: IReactorTCP, client_id: int) -> AccumulatingProtocol reactor factory: The connecting factory to build. """ - factory = reactor.tcpClients[client_id][2] + factory = reactor.tcpClients.pop(client_id)[2] client = factory.buildProtocol(None) server = AccumulatingProtocol() server.makeConnection(FakeTransport(client, reactor)) client.makeConnection(FakeTransport(server, reactor)) - reactor.tcpClients.pop(client_id) - return client, server