From: Federico Caselli Date: Thu, 7 Oct 2021 19:25:41 +0000 (+0200) Subject: Properly close the at hock event loop in test_windows_error X-Git-Tag: 3.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f38422f5c0731a69c3fdbb4e2e56a6b6f7a6dd47;p=thirdparty%2Fpsycopg.git Properly close the at hock event loop in test_windows_error --- 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()