@@ -40,7 +40,6 @@ def test_empty_config_file_is_created_if_not_present():
4040 from tests .conftest import clean_logging_handlers
4141
4242 with TemporaryDirectory () as tmp_dir :
43- # Resolve Windows short paths to prevent cleanup issues
4443 resolved_tmp_dir = path_resolver (tmp_dir )
4544 config_file = Path (resolved_tmp_dir ) / "sub" / "config.toml"
4645 assert config_file .exists () is False
@@ -50,7 +49,6 @@ def test_empty_config_file_is_created_if_not_present():
5049 assert config_file .exists () is True
5150 assert_file_permissions_are_strict (config_file )
5251 finally :
53- # Ensure all logging handlers are closed before temp directory cleanup
5452 clean_logging_handlers ()
5553
5654
@@ -176,19 +174,16 @@ def test_create_default_config_if_not_exists_with_proper_permissions(
176174
177175 mock_get_config_section .return_value = {}
178176 with TemporaryDirectory () as tmp_dir :
179- # Resolve Windows short paths to prevent cleanup issues
180177 resolved_tmp_dir = path_resolver (tmp_dir )
181178 config_path = Path (f"{ resolved_tmp_dir } /snowflake/config.toml" )
182179
183180 try :
184- # Test the config initialization with a specific path
185181 config_init (config_path )
186182
187183 assert config_path .exists ()
188184 assert_file_permissions_are_strict (config_path .parent )
189185 assert_file_permissions_are_strict (config_path )
190186 finally :
191- # Ensure all logging handlers are closed before temp directory cleanup
192187 clean_logging_handlers ()
193188
194189
@@ -244,7 +239,6 @@ def test_not_found_default_connection_from_evn_variable(test_root_path):
244239def test_correct_updates_of_connections_on_setting_default_connection (
245240 test_snowcli_config , snowflake_home
246241):
247- # Use isolated context for this test to avoid fixture conflicts
248242 with fork_cli_context () as ctx :
249243 config = test_snowcli_config
250244 connections_toml = snowflake_home / "connections.toml"
@@ -261,12 +255,10 @@ def test_correct_updates_of_connections_on_setting_default_connection(
261255 """
262256 )
263257
264- # Set config file override in isolated context
265258 ctx .config_file_override = config
266- config_init (None ) # Use context's config file
259+ config_init (None )
267260 set_config_value (path = ["default_connection_name" ], value = "asdf_b" )
268261
269- # Get config manager from isolated context
270262 config_manager = ctx .config_manager
271263
272264 def assert_correct_connections_loaded ():
@@ -316,16 +308,13 @@ def assert_correct_connections_loaded():
316308 config_toml_content .count ("dummy_flag = true" ) == 1
317309 ) # other settings are not erased
318310
319- # reinit config file and recheck loaded connections
320- config_init (None ) # Use context's config file
311+ config_init (None )
321312 assert_correct_connections_loaded ()
322313
323314
324315def test_correct_updates_of_connections_on_setting_default_connection_for_empty_config_file (
325316 config_file , snowflake_home , config_manager
326317):
327- # CONFIG_MANAGER is now accessed through the config_manager fixture
328-
329318 with config_file () as config :
330319 connections_toml = snowflake_home / "connections.toml"
331320 connections_toml .write_text (
@@ -390,16 +379,13 @@ def assert_correct_connections_loaded():
390379 config_toml_content .count ("dummy_flag = true" ) == 0
391380 ) # other settings are not erased
392381
393- # reinit config file and recheck loaded connections
394382 config_init (config )
395383 assert_correct_connections_loaded ()
396384
397385
398386def test_connections_toml_override_config_toml (
399387 test_snowcli_config , snowflake_home , config_manager
400388):
401- # CONFIG_MANAGER is now accessed through the config_manager fixture
402-
403389 connections_toml = snowflake_home / "connections.toml"
404390 connections_toml .write_text (
405391 """[default]
@@ -520,7 +506,6 @@ def test_too_wide_permissions_on_custom_config_file_causes_warning_windows(permi
520506 from tests .conftest import clean_logging_handlers
521507
522508 with TemporaryDirectory () as tmp_dir :
523- # Resolve Windows short paths to prevent cleanup issues
524509 resolved_tmp_dir = path_resolver (tmp_dir )
525510 config_path = Path (resolved_tmp_dir ) / "config.toml"
526511 config_path .touch ()
@@ -538,7 +523,6 @@ def test_too_wide_permissions_on_custom_config_file_causes_warning_windows(permi
538523 ):
539524 config_init (config_file = config_path )
540525 finally :
541- # Ensure all logging handlers are closed before temp directory cleanup
542526 clean_logging_handlers ()
543527
544528
0 commit comments