summary refs log tree commit diff
path: root/tests/util/test_rwlock.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-08-28 16:47:11 -0400
committerGitHub <noreply@github.com>2020-08-28 16:47:11 -0400
commitd2ac767de2ce895a965fb2fcdcb883636f19a5c5 (patch)
tree376538b8b1b257e2e7b8e05ecf656bf0079eeb73 /tests/util/test_rwlock.py
parentFix incorrect return signature (diff)
downloadsynapse-d2ac767de2ce895a965fb2fcdcb883636f19a5c5.tar.xz
Convert ReadWriteLock to async/await. (#8202)
Diffstat (limited to '')
-rw-r--r--tests/util/test_rwlock.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/util/test_rwlock.py b/tests/util/test_rwlock.py
index bd32e2cee7..d3dea3b52a 100644
--- a/tests/util/test_rwlock.py
+++ b/tests/util/test_rwlock.py
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from twisted.internet import defer
 
 from synapse.util.async_helpers import ReadWriteLock
 
@@ -43,6 +44,7 @@ class ReadWriteLockTestCase(unittest.TestCase):
             rwlock.read(key),  # 5
             rwlock.write(key),  # 6
         ]
+        ds = [defer.ensureDeferred(d) for d in ds]
 
         self._assert_called_before_not_after(ds, 2)
 
@@ -73,12 +75,12 @@ class ReadWriteLockTestCase(unittest.TestCase):
         with ds[6].result:
             pass
 
-        d = rwlock.write(key)
+        d = defer.ensureDeferred(rwlock.write(key))
         self.assertTrue(d.called)
         with d.result:
             pass
 
-        d = rwlock.read(key)
+        d = defer.ensureDeferred(rwlock.read(key))
         self.assertTrue(d.called)
         with d.result:
             pass