mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 15:54:49 -04:00
Do not yield on awaitables in tests. (#8193)
This commit is contained in:
parent
b49a5b9307
commit
e00816ad98
15 changed files with 230 additions and 131 deletions
|
@ -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
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue