@@ -320,7 +320,11 @@ def test_multiple_connections_independent_replacement(config_ng_setup):
320320def test_empty_connection_replacement (config_ng_setup ):
321321 """
322322 Test that an empty connection in a later FILE source still replaces
323- the entire connection from earlier sources, resulting in no configured connection.
323+ the entire connection from earlier sources.
324+
325+ The empty connection is considered valid (it exists in config), but has
326+ no parameters. Validation of required fields happens when actually using
327+ the connection to connect to Snowflake.
324328 """
325329 cli_config = """
326330 [connections.test]
@@ -335,15 +339,16 @@ def test_empty_connection_replacement(config_ng_setup):
335339 """
336340
337341 with config_ng_setup (cli_config = cli_config , connections_toml = connections_toml ):
338- import pytest
339342 from snowflake .cli .api .config import get_connection_dict
340- from snowflake .cli .api .exceptions import MissingConfigurationError
341343
342- # Empty connection replacement means no parameters, which raises an error
343- with pytest .raises (
344- MissingConfigurationError , match = "Connection test is not configured"
345- ):
346- get_connection_dict ("test" )
344+ # Empty connection replacement: connection exists but has no parameters
345+ conn = get_connection_dict ("test" )
346+ assert conn == {} # Connection exists but is empty
347+
348+ # No parameters from cli_config are inherited (connection was replaced)
349+ assert "account" not in conn
350+ assert "user" not in conn
351+ assert "warehouse" not in conn
347352
348353
349354def test_overlay_precedence_connection_specific_over_global (config_ng_setup ):
0 commit comments