diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-28 16:47:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 16:47:11 -0400 |
commit | d2ac767de2ce895a965fb2fcdcb883636f19a5c5 (patch) | |
tree | 376538b8b1b257e2e7b8e05ecf656bf0079eeb73 /tests/util/test_rwlock.py | |
parent | Fix incorrect return signature (diff) | |
download | synapse-d2ac767de2ce895a965fb2fcdcb883636f19a5c5.tar.xz |
Convert ReadWriteLock to async/await. (#8202)
Diffstat (limited to '')
-rw-r--r-- | tests/util/test_rwlock.py | 6 |
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 |