From d2929fc6e40b9b0debdda8195d3bb7901ca8de67 Mon Sep 17 00:00:00 2001 From: Thomas Emmerling Date: Thu, 18 Aug 2016 15:13:52 +0200 Subject: [PATCH] TEST: Fix rint error message filtering in test_image_api. --- nibabel/tests/test_image_api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nibabel/tests/test_image_api.py b/nibabel/tests/test_image_api.py index 4efb876f88..3ebd3b7a78 100644 --- a/nibabel/tests/test_image_api.py +++ b/nibabel/tests/test_image_api.py @@ -148,7 +148,8 @@ def validate_header_deprecated(self, imaker, params): with clear_and_catch_warnings() as w: warnings.simplefilter('always', DeprecationWarning) # Ignore numpy.rint warning in python3/windows - warnings.simplefilter('ignore', RuntimeWarning, 726) + warnings.filterwarnings('ignore', + 'invalid value encountered in rint') img = imaker() hdr = img.get_header() assert_equal(len(w), 1) @@ -170,6 +171,9 @@ def validate_shape_deprecated(self, imaker, params): # Check deprecated get_shape API with clear_and_catch_warnings() as w: warnings.simplefilter('always', DeprecationWarning) + # Ignore numpy.rint warning in python3/windows + warnings.filterwarnings('ignore', + 'invalid value encountered in rint') img = imaker() assert_equal(img.get_shape(), params['shape']) assert_equal(len(w), 1)