From dbe42bd9bdb9f1178e216228d25a45b012820cd2 Mon Sep 17 00:00:00 2001 From: Mark Keller Date: Thu, 7 Nov 2024 22:54:11 +0000 Subject: [PATCH] fix old driver tests --- test/integ/conftest.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/integ/conftest.py b/test/integ/conftest.py index 95b68482c..e6d579668 100644 --- a/test/integ/conftest.py +++ b/test/integ/conftest.py @@ -17,11 +17,15 @@ import snowflake.connector from snowflake.connector.compat import IS_WINDOWS -from snowflake.connector.config_manager import CONFIG_MANAGER from snowflake.connector.connection import DefaultConverterClass from .. import running_on_public_ci +try: + from snowflake.connector.config_manager import CONFIG_MANAGER +finally: + CONFIG_MANAGER = None + try: from ..parameters import CONNECTION_PARAMETERS except ImportError: @@ -123,7 +127,10 @@ def get_db_parameters(connection_name: str = "default") -> dict[str, Any]: if connection_name == "default" else connection_name ) - if cm_connection_name in CONFIG_MANAGER["connections"]: + if ( + CONFIG_MANAGER is not None + and cm_connection_name in CONFIG_MANAGER["connections"] + ): # If config_manager knows of this connection then use it ret = CONFIG_MANAGER["connections"][cm_connection_name].value.value else: