99from autointent .context .data_handler import DataHandler
1010
1111
12- def test_finetune_dump_load (dataset ):
12+ def test_finetune_dump_load (dataset , on_windows ):
1313 """Test scenario: fine-tune -> dump -> load."""
1414 data_handler = DataHandler (dataset )
1515
@@ -24,7 +24,7 @@ def test_finetune_dump_load(dataset):
2424
2525 train_config = EmbedderFineTuningConfig (epoch_num = 1 , batch_size = 4 , early_stopping = False )
2626
27- with tempfile .TemporaryDirectory () as temp_dir :
27+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = on_windows ) as temp_dir :
2828 temp_path = Path (temp_dir )
2929
3030 # Step 1: Fine-tune the embedder
@@ -64,7 +64,7 @@ def test_finetune_dump_load(dataset):
6464 )
6565
6666
67- def test_dump_load_finetune (dataset ):
67+ def test_dump_load_finetune (dataset , on_windows ):
6868 """Test scenario: dump -> load -> fine-tune."""
6969 data_handler = DataHandler (dataset )
7070
@@ -79,7 +79,7 @@ def test_dump_load_finetune(dataset):
7979
8080 train_config = EmbedderFineTuningConfig (epoch_num = 1 , batch_size = 4 , early_stopping = False )
8181
82- with tempfile .TemporaryDirectory () as temp_dir :
82+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = on_windows ) as temp_dir :
8383 temp_path = Path (temp_dir )
8484
8585 # Step 1: Create and dump original embedder (not fine-tuned)
@@ -116,11 +116,11 @@ def test_dump_load_finetune(dataset):
116116 ), "Embeddings should change after fine-tuning the loaded model"
117117
118118
119- def test_load_from_disk_finetune_dump_load (dataset ):
119+ def test_load_from_disk_finetune_dump_load (dataset , on_windows ):
120120 """Test scenario: load sentence transformer from disk -> fine-tune -> dump -> load."""
121121 data_handler = DataHandler (dataset )
122122
123- with tempfile .TemporaryDirectory () as temp_dir :
123+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = on_windows ) as temp_dir :
124124 temp_path = Path (temp_dir )
125125
126126 # Step 1: Save a sentence transformer model to disk
@@ -173,7 +173,7 @@ def test_load_from_disk_finetune_dump_load(dataset):
173173 )
174174
175175
176- def test_embeddings_consistency_across_workflows (dataset ):
176+ def test_embeddings_consistency_across_workflows (dataset , on_windows ):
177177 """Test that different workflows produce consistent results when starting from same model."""
178178 data_handler = DataHandler (dataset )
179179
@@ -193,7 +193,7 @@ def test_embeddings_consistency_across_workflows(dataset):
193193 "labels" : data_handler .train_labels (0 )[:50 ],
194194 }
195195
196- with tempfile .TemporaryDirectory () as temp_dir :
196+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = on_windows ) as temp_dir :
197197 temp_path = Path (temp_dir )
198198
199199 # Workflow 1: Direct fine-tune
@@ -217,7 +217,7 @@ def test_embeddings_consistency_across_workflows(dataset):
217217 )
218218
219219
220- def test_multiple_dump_load_cycles_after_finetuning (dataset ):
220+ def test_multiple_dump_load_cycles_after_finetuning (dataset , on_windows ):
221221 """Test that multiple dump/load cycles preserve fine-tuned model state."""
222222 data_handler = DataHandler (dataset )
223223
@@ -231,7 +231,7 @@ def test_multiple_dump_load_cycles_after_finetuning(dataset):
231231
232232 train_config = EmbedderFineTuningConfig (epoch_num = 1 , batch_size = 4 , early_stopping = False )
233233
234- with tempfile .TemporaryDirectory () as temp_dir :
234+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = on_windows ) as temp_dir :
235235 temp_path = Path (temp_dir )
236236
237237 # Fine-tune original embedder
0 commit comments