From 88b9b347dd5472ee5b4af20e4ac8a83d7dafb001 Mon Sep 17 00:00:00 2001 From: Christophe Oudar Date: Sun, 15 Dec 2024 03:02:00 +0100 Subject: [PATCH] Check that test_adapter exist before closing --- sqlmesh/core/context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlmesh/core/context.py b/sqlmesh/core/context.py index 85fb54db29..9d8cb65104 100644 --- a/sqlmesh/core/context.py +++ b/sqlmesh/core/context.py @@ -1653,7 +1653,8 @@ def create_test( include_ctes=include_ctes, ) finally: - test_adapter.close() + if test_adapter: + test_adapter.close() @python_api_analytics def test(