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: