Blob Blame History Raw
From 9636d37d35b55b64c5d730bc85a72c46f717d611 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <encukou@gmail.com>
Date: Fri, 10 Jun 2022 13:40:46 +0200
Subject: [PATCH] test_sync_async_add: After closing the default event loop,
 set a new one

---
 tests/test_asynctestcase.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/test_asynctestcase.py b/tests/test_asynctestcase.py
index bdc5a9e..52844bc 100644
--- a/tests/test_asynctestcase.py
+++ b/tests/test_asynctestcase.py
@@ -33,6 +33,9 @@ def test_sync_async_add(self):
         loop.close()
         self.assertEqual(ret, 6)
 
+        # Set a new event loop, since we closed the old one
+        asyncio.set_event_loop(asyncio.new_event_loop())
+
     async def test_await_async_add(self):
         ret = await async_add(1, 5)
         self.assertEqual(ret, 6)