@@ -354,14 +354,17 @@ def test_check_value_source_for_env_var(self):
354354class TestConfigurationExplanationResults :
355355 """Tests for get_configuration_explanation_results helper."""
356356
357- @mock .patch .dict (os .environ , {ALTERNATIVE_CONFIG_ENV_VAR : "1" }, clear = True )
358357 @mock .patch ("snowflake.cli.api.config_ng.resolution_logger.ResolutionPresenter" )
359358 @mock .patch ("snowflake.cli.api.config_ng.resolution_logger.get_resolver" )
360359 @mock .patch (
361360 "snowflake.cli.api.config_ng.resolution_logger.get_config_provider_singleton"
362361 )
363362 def test_includes_diagnostics_message_non_verbose (
364- self , mock_provider , mock_get_resolver , mock_presenter_cls
363+ self ,
364+ mock_provider ,
365+ mock_get_resolver ,
366+ mock_presenter_cls ,
367+ windows_home_env ,
365368 ):
366369 from snowflake .cli .api .output .types import (
367370 CollectionResult ,
@@ -377,19 +380,24 @@ def test_includes_diagnostics_message_non_verbose(
377380 table_result = CollectionResult ([])
378381 presenter .build_sources_table .return_value = table_result
379382
380- result = get_configuration_explanation_results (verbose = False )
383+ env_vars = {ALTERNATIVE_CONFIG_ENV_VAR : "1" , ** windows_home_env }
384+ with mock .patch .dict (os .environ , env_vars , clear = True ):
385+ result = get_configuration_explanation_results (verbose = False )
381386 assert isinstance (result , MultipleResults )
382387 outputs = list (result .result )
383388 assert outputs == [diag_message , table_result ]
384389
385- @mock .patch .dict (os .environ , {ALTERNATIVE_CONFIG_ENV_VAR : "1" }, clear = True )
386390 @mock .patch ("snowflake.cli.api.config_ng.resolution_logger.ResolutionPresenter" )
387391 @mock .patch ("snowflake.cli.api.config_ng.resolution_logger.get_resolver" )
388392 @mock .patch (
389393 "snowflake.cli.api.config_ng.resolution_logger.get_config_provider_singleton"
390394 )
391395 def test_includes_diagnostics_message_verbose (
392- self , mock_provider , mock_get_resolver , mock_presenter_cls
396+ self ,
397+ mock_provider ,
398+ mock_get_resolver ,
399+ mock_presenter_cls ,
400+ windows_home_env ,
393401 ):
394402 from snowflake .cli .api .output .types import (
395403 CollectionResult ,
@@ -408,7 +416,9 @@ def test_includes_diagnostics_message_verbose(
408416 presenter .build_sources_table .return_value = table_result
409417 presenter .format_history_message .return_value = history_message
410418
411- result = get_configuration_explanation_results (verbose = True )
419+ env_vars = {ALTERNATIVE_CONFIG_ENV_VAR : "1" , ** windows_home_env }
420+ with mock .patch .dict (os .environ , env_vars , clear = True ):
421+ result = get_configuration_explanation_results (verbose = True )
412422 assert isinstance (result , MultipleResults )
413423 outputs = list (result .result )
414424 assert outputs == [diag_message , table_result , history_message ]
0 commit comments