From: Yaroslav Halchenko Date: Sun, 4 Sep 2016 14:18:55 +0000 (+0100) 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~1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=823a55393beb5f9712ede55a0a6558bbab6397a8;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