From f38422f5c0731a69c3fdbb4e2e56a6b6f7a6dd47 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Thu, 7 Oct 2021 21:25:41 +0200 Subject: [PATCH] Properly close the at hock event loop in test_windows_error --- tests/test_connection_async.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_connection_async.py b/tests/test_connection_async.py index f6be5f463..e0bb74c16 100644 --- a/tests/test_connection_async.py +++ b/tests/test_connection_async.py @@ -682,4 +682,8 @@ def test_windows_error(dsn): ): await psycopg.AsyncConnection.connect(dsn) - loop.run_until_complete(go()) + try: + loop.run_until_complete(go()) + finally: + loop.run_until_complete(loop.shutdown_asyncgens()) + loop.close() -- 2.47.2