From 78b99de7c206b106340e12cdee0af9aa246bd5ad Mon Sep 17 00:00:00 2001 From: Sean Quah <8349537+squahtx@users.noreply.github.com> Date: Wed, 27 Apr 2022 14:58:26 +0100 Subject: 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 --- changelog.d/12505.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12505.misc (limited to 'changelog.d') 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. -- cgit 1.4.1