diff --git a/tests/_utils/db_test.py b/tests/_utils/db_test.py index 3b84b1c9..20d83f55 100644 --- a/tests/_utils/db_test.py +++ b/tests/_utils/db_test.py @@ -55,10 +55,9 @@ def _perform_query(query): database='postgres' ) try: - with connection: - connection.autocommit = True # required for meta queries - with connection.cursor() as cursor: - return cursor.execute(query) + connection.autocommit = True # required for meta queries + with connection.cursor() as cursor: + return cursor.execute(query) finally: connection.close()