Skip to content

Commit

Permalink
TEST: Fix rint error message filtering in test_image_api.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomastweets committed Aug 18, 2016
1 parent 9a13fd2 commit d2929fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nibabel/tests/test_image_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d2929fc

Please sign in to comment.