Skip to content

Commit 3a170db

Browse files
committed
add proper cleanup for testfiles
1 parent eda5c59 commit 3a170db

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

neo/test/iotest/test_get_io.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55

66
def test_list_candidate_ios_non_existant_file():
77
# use plexon io suffix for testing here
8-
non_existant_file = 'non_existant_folder/non_existant_file.plx'
8+
non_existant_file = Path('non_existant_folder/non_existant_file.plx')
9+
non_existant_file.unlink(missing_ok=True)
910
ios = list_candidate_ios(non_existant_file)
1011

1112
assert ios
1213

14+
# cleanup
15+
non_existant_file.unlink(missing_ok=True)
16+
1317

1418
def test_list_candidate_ios_filename_stub():
1519
# create dummy folder with dummy files
@@ -27,7 +31,11 @@ def test_list_candidate_ios_filename_stub():
2731

2832
def test_get_io_non_existant_file_writable_io():
2933
# use nixio for testing with writable io
30-
non_existant_file = 'non_existant_file.nix'
34+
non_existant_file = Path('non_existant_file.nix')
35+
non_existant_file.unlink(missing_ok=True)
3136
io = get_io(non_existant_file)
3237

3338
assert isinstance(io, NixIO)
39+
40+
# cleanup
41+
non_existant_file.unlink(missing_ok=True)

0 commit comments

Comments
 (0)