Skip to content

Commit 73e126c

Browse files
committed
fix: loader_test PermissionError
1 parent cbc9aaa commit 73e126c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/unit/configs/test_loader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class TestConfig(BaseModel):
2626

2727
@fixture
2828
def config_file():
29-
_, config_path = tempfile.mkstemp(suffix=".yaml")
29+
fd, config_path = tempfile.mkstemp(suffix=".yaml")
30+
os.close(fd)
3031

3132
config_content = {
3233
"llm": {
@@ -59,7 +60,8 @@ def preset_files():
5960
presets = [{"fix_tries": 3}, {"predictor_init_kwargs": {"with_tune": False}}]
6061
preset_paths = []
6162
for preset in presets:
62-
_, path = tempfile.mkstemp(suffix=".yaml")
63+
fd, path = tempfile.mkstemp(suffix=".yaml")
64+
os.close(fd) # Close the file descriptor to avoid PermissionError on Windows
6365
preset_paths.append(path)
6466
with open(path, "w") as f:
6567
yaml.safe_dump(preset, f, indent=2)

0 commit comments

Comments
 (0)