summary refs log tree commit diff
path: root/tests/federation
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-08-27 17:24:46 -0400
committerGitHub <noreply@github.com>2020-08-27 17:24:46 -0400
commite00816ad98a1165b67238f9711cb1b0e7135f25f (patch)
tree3b0135e8c57b2b9082191088237298f7b50615f7 /tests/federation
parentConvert stats and related calls to async/await (#8192) (diff)
downloadsynapse-e00816ad98a1165b67238f9711cb1b0e7135f25f.tar.xz
Do not yield on awaitables in tests. (#8193)
Diffstat (limited to 'tests/federation')
-rw-r--r--tests/federation/test_complexity.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/federation/test_complexity.py b/tests/federation/test_complexity.py
index 9bd515080c..3d880c499d 100644
--- a/tests/federation/test_complexity.py
+++ b/tests/federation/test_complexity.py
@@ -15,8 +15,6 @@
 
 from mock import Mock
 
-from twisted.internet import defer
-
 from synapse.api.errors import Codes, SynapseError
 from synapse.rest import admin
 from synapse.rest.client.v1 import login, room
@@ -60,7 +58,7 @@ class RoomComplexityTests(unittest.FederatingHomeserverTestCase):
 
         # Artificially raise the complexity
         store = self.hs.get_datastore()
-        store.get_current_state_event_counts = lambda x: defer.succeed(500 * 1.23)
+        store.get_current_state_event_counts = lambda x: make_awaitable(500 * 1.23)
 
         # Get the room complexity again -- make sure it's our artificial value
         request, channel = self.make_request(
@@ -160,7 +158,7 @@ class RoomComplexityTests(unittest.FederatingHomeserverTestCase):
         )
 
         # Artificially raise the complexity
-        self.hs.get_datastore().get_current_state_event_counts = lambda x: defer.succeed(
+        self.hs.get_datastore().get_current_state_event_counts = lambda x: make_awaitable(
             600
         )