@@ -70,7 +70,9 @@ def test_dda_plex_dataset():
70
70
pytest .skip ("DDA-plex test files not found" )
71
71
72
72
# Create a temporary database path
73
- temp_db_path = tempfile .mktemp (suffix = ".duckdb" )
73
+ temp_fd , temp_db_path = tempfile .mkstemp (suffix = ".duckdb" )
74
+ os .close (temp_fd )
75
+ os .unlink (temp_db_path )
74
76
75
77
indexer = None
76
78
try :
@@ -206,7 +208,9 @@ def test_dda_lfq_dataset():
206
208
pytest .skip ("DDA-LFQ test files not found" )
207
209
208
210
# Create a temporary database path
209
- temp_db_path = tempfile .mktemp (suffix = ".duckdb" )
211
+ temp_fd , temp_db_path = tempfile .mkstemp (suffix = ".duckdb" )
212
+ os .close (temp_fd )
213
+ os .unlink (temp_db_path )
210
214
211
215
indexer = None
212
216
try :
@@ -341,7 +345,9 @@ def test_add_msstats_to_existing_db():
341
345
pytest .skip ("DDA-LFQ test files not found" )
342
346
343
347
# Create a temporary database path
344
- temp_db_path = tempfile .mktemp (suffix = ".duckdb" )
348
+ temp_fd , temp_db_path = tempfile .mkstemp (suffix = ".duckdb" )
349
+ os .close (temp_fd )
350
+ os .unlink (temp_db_path )
345
351
346
352
indexer1 = None
347
353
indexer2 = None
@@ -415,7 +421,9 @@ def test_mztab_metadata_parsing():
415
421
pytest .skip ("DDA-plex test files not found" )
416
422
417
423
# Create a temporary database path
418
- temp_db_path = tempfile .mktemp (suffix = ".duckdb" )
424
+ temp_fd , temp_db_path = tempfile .mkstemp (suffix = ".duckdb" )
425
+ os .close (temp_fd ) # Close file descriptor, let DuckDB create the file
426
+ os .unlink (temp_db_path ) # Remove the empty file
419
427
420
428
indexer = None
421
429
try :
@@ -456,7 +464,9 @@ def test_mztab_stream_section():
456
464
pytest .skip ("DDA-plex test files not found" )
457
465
458
466
# Create a temporary database path
459
- temp_db_path = tempfile .mktemp (suffix = ".duckdb" )
467
+ temp_fd , temp_db_path = tempfile .mkstemp (suffix = ".duckdb" )
468
+ os .close (temp_fd )
469
+ os .unlink (temp_db_path )
460
470
461
471
indexer = None
462
472
try :
0 commit comments