Skip to content

Commit

Permalink
add proper cleanup for testfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaSprenger committed Jun 20, 2023
1 parent eda5c59 commit 3a170db
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions neo/test/iotest/test_get_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

0 comments on commit 3a170db

Please sign in to comment.