File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 6868
6969@pytest .fixture ()
7070def enable_events_and_metrics_config ():
71+ from snowflake .cli .api .utils .path_utils import path_resolver
72+ from tests .conftest import clean_logging_handlers
73+
7174 with TemporaryDirectory () as tempdir :
72- config_toml = Path (tempdir ) / "config.toml"
75+ # Resolve Windows short paths to prevent cleanup issues
76+ resolved_tempdir = path_resolver (tempdir )
77+ config_toml = Path (resolved_tempdir ) / "config.toml"
7378 config_toml .write_text (
7479 "[cli.features]\n "
7580 "enable_spcs_service_events = true\n "
7681 "enable_spcs_service_metrics = true\n "
7782 )
78- yield config_toml
83+ try :
84+ yield config_toml
85+ finally :
86+ # Ensure all logging handlers are closed before temp directory cleanup
87+ clean_logging_handlers ()
7988
8089
8190@patch (EXECUTE_QUERY )
You can’t perform that action at this time.
0 commit comments