Skip to content

Commit dbe42bd

Browse files
fix old driver tests
1 parent 610a6e5 commit dbe42bd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/integ/conftest.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717

1818
import snowflake.connector
1919
from snowflake.connector.compat import IS_WINDOWS
20-
from snowflake.connector.config_manager import CONFIG_MANAGER
2120
from snowflake.connector.connection import DefaultConverterClass
2221

2322
from .. import running_on_public_ci
2423

24+
try:
25+
from snowflake.connector.config_manager import CONFIG_MANAGER
26+
finally:
27+
CONFIG_MANAGER = None
28+
2529
try:
2630
from ..parameters import CONNECTION_PARAMETERS
2731
except ImportError:
@@ -123,7 +127,10 @@ def get_db_parameters(connection_name: str = "default") -> dict[str, Any]:
123127
if connection_name == "default"
124128
else connection_name
125129
)
126-
if cm_connection_name in CONFIG_MANAGER["connections"]:
130+
if (
131+
CONFIG_MANAGER is not None
132+
and cm_connection_name in CONFIG_MANAGER["connections"]
133+
):
127134
# If config_manager knows of this connection then use it
128135
ret = CONFIG_MANAGER["connections"][cm_connection_name].value.value
129136
else:

0 commit comments

Comments
 (0)