summary refs log tree commit diff
path: root/changelog.d/12505.misc
diff options
context:
space:
mode:
authorSean Quah <8349537+squahtx@users.noreply.github.com>2022-04-27 14:58:26 +0100
committerGitHub <noreply@github.com>2022-04-27 14:58:26 +0100
commit78b99de7c206b106340e12cdee0af9aa246bd5ad (patch)
tree7eb94bb066b8ed0b23fa160056b5e9bcdb29dd8e /changelog.d/12505.misc
parentAdd a module API to allow modules to edit push rule actions (#12406) (diff)
downloadsynapse-78b99de7c206b106340e12cdee0af9aa246bd5ad.tar.xz
Prefer `make_awaitable` over `defer.succeed` in tests (#12505)
When configuring the return values of mocks, prefer awaitables from
`make_awaitable` over `defer.succeed`. `Deferred`s are only awaitable
once, so it is inappropriate for a mock to return the same `Deferred`
multiple times.

Also update `run_in_background` to support functions that return
arbitrary awaitables.

Signed-off-by: Sean Quah <seanq@element.io>
Diffstat (limited to 'changelog.d/12505.misc')
-rw-r--r--changelog.d/12505.misc1
1 files changed, 1 insertions, 0 deletions
diff --git a/changelog.d/12505.misc b/changelog.d/12505.misc
new file mode 100644
index 0000000000..a691d7962f
--- /dev/null
+++ b/changelog.d/12505.misc
@@ -0,0 +1 @@
+Use `make_awaitable` instead of `defer.succeed` for return values of mocks in tests.