Skip to content

Commit bfc0013

Browse files
committed
TEST: Test explicitly passing in value for ArrayProxy keep_file_open parameter
1 parent cd65af4 commit bfc0013

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nibabel/tests/test_arrayproxy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,14 @@ def test_keep_file_open_default():
413413
mock.patch('indexed_gzip.SafeIndexedGzipFile', gzip.GzipFile):
414414
proxy = ArrayProxy(fname, ((10, 10, 10), dtype))
415415
assert proxy._keep_file_open
416+
proxy = ArrayProxy(fname, ((10, 10, 10), dtype), keep_file_open='auto')
417+
assert proxy._keep_file_open
416418
# If no have_indexed_gzip, then keep_file_open should be False
417419
with mock.patch.dict('sys.modules', {'indexed_gzip' : None}):
418420
proxy = ArrayProxy(fname, ((10, 10, 10), dtype))
419421
assert not proxy._keep_file_open
422+
proxy = ArrayProxy(fname, ((10, 10, 10), dtype), keep_file_open='auto')
423+
assert not proxy._keep_file_open
420424

421425
def test_pickle_lock():
422426
# Test that ArrayProxy can be pickled, and that thread lock is created

0 commit comments

Comments
 (0)