From 3a170db201deafe8514cd0e27557fcec2395ce35 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Tue, 20 Jun 2023 15:06:56 +0200 Subject: [PATCH] add proper cleanup for testfiles --- neo/test/iotest/test_get_io.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/neo/test/iotest/test_get_io.py b/neo/test/iotest/test_get_io.py index ef63f2c8f..b43499b05 100644 --- a/neo/test/iotest/test_get_io.py +++ b/neo/test/iotest/test_get_io.py @@ -5,11 +5,15 @@ def test_list_candidate_ios_non_existant_file(): # use plexon io suffix for testing here - non_existant_file = 'non_existant_folder/non_existant_file.plx' + non_existant_file = Path('non_existant_folder/non_existant_file.plx') + non_existant_file.unlink(missing_ok=True) ios = list_candidate_ios(non_existant_file) assert ios + # cleanup + non_existant_file.unlink(missing_ok=True) + def test_list_candidate_ios_filename_stub(): # create dummy folder with dummy files @@ -27,7 +31,11 @@ def test_list_candidate_ios_filename_stub(): def test_get_io_non_existant_file_writable_io(): # use nixio for testing with writable io - non_existant_file = 'non_existant_file.nix' + non_existant_file = Path('non_existant_file.nix') + non_existant_file.unlink(missing_ok=True) io = get_io(non_existant_file) assert isinstance(io, NixIO) + + # cleanup + non_existant_file.unlink(missing_ok=True)