Skip to content

Commit e19dad6

Browse files
committed
SNOW-2306184: ms fixes p3
1 parent 1e9d562 commit e19dad6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests_common/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@
3535

3636
@pytest.fixture
3737
def temporary_directory():
38+
from snowflake.cli.api.utils.path_utils import path_resolver
39+
from tests.conftest import clean_logging_handlers
40+
3841
initial_dir = os.getcwd()
3942

4043
with tempfile.TemporaryDirectory() as tmp_dir:
44+
# Resolve Windows short paths to prevent cleanup issues
45+
resolved_tmp_dir = path_resolver(tmp_dir)
4146
try:
42-
os.chdir(tmp_dir)
43-
yield tmp_dir
47+
os.chdir(resolved_tmp_dir)
48+
yield resolved_tmp_dir
4449
finally:
4550
os.chdir(initial_dir)
51+
# Ensure all logging handlers are closed before temp directory cleanup
52+
clean_logging_handlers()
4653

4754

4855
# Borrowed from tests_integration/test_utils.py

0 commit comments

Comments
 (0)