Skip to content

Commit 63ff5ef

Browse files
committed
TEST: Another fix to existing unit test
1 parent f5b92d2 commit 63ff5ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nibabel/tests/test_openers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ class StrictOpener(Opener):
232232
if lext != ext: # extension should not be recognized -> file
233233
assert_true(isinstance(fobj.fobj, file_class))
234234
elif lext == 'gz':
235-
assert_true(isinstance(fobj.fobj, GzipFile))
235+
try:
236+
from indexed_gzip import IndexedGzipFile
237+
except ImportError:
238+
IndexedGzipFile = GzipFile
239+
assert_true(isinstance(fobj.fobj, (GzipFile, IndexedGzipFile)))
236240
else:
237241
assert_true(isinstance(fobj.fobj, BZ2File))
238242

0 commit comments

Comments
 (0)