File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11from pathlib import Path
22from tempfile import TemporaryDirectory
3+ import platform
34from neo .io import get_io , list_candidate_ios , NixIO
5+ import pytest
6+ try :
7+ import nixio
8+ HAVE_NIX = True
9+ except :
10+ HAVE_NIX = False
411
512
613def test_list_candidate_ios_non_existant_file ():
@@ -28,7 +35,7 @@ def test_list_candidate_ios_filename_stub():
2835
2936 assert NixIO in ios
3037
31-
38+ @ pytest . mark . skipif ( not HAVE_NIX or platform . system () == 'Windows' , reason = 'Need nixio in order to return NixIO class' )
3239def test_get_io_non_existant_file_writable_io ():
3340 # use nixio for testing with writable io
3441 non_existant_file = Path ("non_existant_file.nix" )
@@ -38,4 +45,4 @@ def test_get_io_non_existant_file_writable_io():
3845 assert isinstance (io , NixIO )
3946
4047 # cleanup
41- non_existant_file .unlink (missing_ok = True )
48+ non_existant_file .unlink (missing_ok = True ) # cleanup will fail on Windows so need to skip
You can’t perform that action at this time.
0 commit comments