Convert additional database methods to async (select list, search, insert_many, delete_*) (#8168)

This commit is contained in:
Patrick Cloke 2020-08-27 07:41:01 -04:00 committed by GitHub
parent 4a739c73b4
commit 30426c7063
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 67 additions and 84 deletions

View file

@ -67,13 +67,12 @@ class BackgroundUpdateTestCase(unittest.HomeserverTestCase):
# second step: complete the update
# we should now get run with a much bigger number of items to update
@defer.inlineCallbacks
def update(progress, count):
async def update(progress, count):
self.assertEqual(progress, {"my_key": 2})
self.assertAlmostEqual(
count, target_background_update_duration_ms / duration_ms, places=0,
)
yield self.updates._end_background_update("test_update")
await self.updates._end_background_update("test_update")
return count
self.update_handler.side_effect = update