summary refs log tree commit diff
path: root/tests/storage/test_background_update.py
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/storage/test_background_update.py
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/storage/test_background_update.py')
-rw-r--r--tests/storage/test_background_update.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/storage/test_background_update.py b/tests/storage/test_background_update.py
index 1a1c59256c..02aae1c13d 100644
--- a/tests/storage/test_background_update.py
+++ b/tests/storage/test_background_update.py
@@ -1,7 +1,5 @@
 from mock import Mock
 
-from twisted.internet import defer
-
 from synapse.storage.background_updates import BackgroundUpdater
 
 from tests import unittest
@@ -38,11 +36,10 @@ class BackgroundUpdateTestCase(unittest.HomeserverTestCase):
         )
 
         # first step: make a bit of progress
-        @defer.inlineCallbacks
-        def update(progress, count):
-            yield self.clock.sleep((count * duration_ms) / 1000)
+        async def update(progress, count):
+            await self.clock.sleep((count * duration_ms) / 1000)
             progress = {"my_key": progress["my_key"] + 1}
-            yield store.db_pool.runInteraction(
+            await store.db_pool.runInteraction(
                 "update_progress",
                 self.updates._background_update_progress_txn,
                 "test_update",