From 017f860005f492081ad04cb9892ef833f7c027d5 Mon Sep 17 00:00:00 2001 From: Sergey Vasilyev Date: Mon, 18 Nov 2024 20:11:05 +0100 Subject: [PATCH] Fix the StopIteration errors from aresponses in some tests Signed-off-by: Sergey Vasilyev --- tests/peering/test_keepalive.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/peering/test_keepalive.py b/tests/peering/test_keepalive.py index 8b8eee32..3c15e813 100644 --- a/tests/peering/test_keepalive.py +++ b/tests/peering/test_keepalive.py @@ -28,3 +28,6 @@ async def test_background_task_runs(mocker, settings, namespaced_peering_resourc assert sleep_mock.call_args_list[2][0][0] == 33 - 9 assert touch_mock.call_count == 4 # 3 updates + 1 clean-up + + # An hack for `aresponses` that calls `sleep(0)` on finalization and fails on StopIteration. + mocker.stopall()