Skip to content

Commit 7562b59

Browse files
committed
TST: If a file doesn't exist, we want an informative error.
Currently raises a "couldn't work out file-type for this file" error.
1 parent 7e41691 commit 7562b59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nibabel/tests/test_loadsave.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def test_read_img_data():
5353
del img
5454

5555

56+
def test_file_not_found():
57+
assert_raises(FileNotFoundError, load, 'does_not_exist.nii.gz')
58+
59+
5660
def test_read_img_data_nifti():
5761
shape = (2, 3, 4)
5862
data = np.random.normal(size=shape)

0 commit comments

Comments
 (0)