From af6ec801eceb82d67bd6038f76c422ce21de4a46 Mon Sep 17 00:00:00 2001 From: Christophe Oudar Date: Mon, 16 Dec 2024 03:34:00 +0100 Subject: [PATCH] Check that test_adapter exist before closing (#3518) --- 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 85fb54db2..9d8cb6510 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(