From: Yaroslav Halchenko Date: Sat, 4 Nov 2017 03:07:42 +0000 (+0000) Subject: BF: allow for generic IOError-based exception to be thrown when loading non existing... X-Git-Tag: archive/raspbian/0.4.1-1+rpi1~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5586a4997ac295af6e85f7b70fab0c8bf3bb0094;p=nipy.git BF: allow for generic IOError-based exception to be thrown when loading non existing file Gbp-Pq: Name changeset_751531a2894e69383f75e6a9b97586e74759ab1b.diff --- diff --git a/nipy/io/tests/test_image_io.py b/nipy/io/tests/test_image_io.py index 3bc1549..fa8e2c6 100644 --- a/nipy/io/tests/test_image_io.py +++ b/nipy/io/tests/test_image_io.py @@ -41,7 +41,10 @@ def load_template_img(): def test_badfile(): filename = "bad_file.foo" - assert_raises(ImageFileError, load_image, filename) + # nibabel prior 2.1.0 was throwing ImageFileError and then more specific + # FileNotFileNotFoundError which should be a subclass of IOError. + # To not mess with version specific imports, checking for IOError + assert_raises((ImageFileError, IOError), load_image, filename) @if_templates