Skip to content

Commit

Permalink
TEST: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Dec 21, 2017
1 parent bddf15c commit 1da0097
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nibabel/tests/test_nifti1.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def test_freesurfer_ico7_hack(self):
nii2 = load('test.nii')
assert_equal(nii.shape, nii2.shape)
assert_array_equal(nii.get_data(), nii2.get_data())
assert_array_equal(nii.get_affine(), nii2.get_affine())
assert_array_equal(nii.affine, nii2.affine)

def test_qform_sform(self):
HC = self.header_class
Expand Down Expand Up @@ -1036,6 +1036,8 @@ def test_norm_zooms_edge_cases(self):
aff = np.eye(4)
img = img_klass(arr, aff)

warnings.simplefilter('always')

# Unknown units = 2 warnings
with warnings.catch_warnings(record=True) as warns:
assert_array_almost_equal(img.header.get_norm_zooms(),
Expand Down Expand Up @@ -1079,6 +1081,8 @@ def test_norm_zooms_edge_cases(self):
assert_array_almost_equal(img.header.get_zooms(), (2, 2, 2, 2.5))
assert_equal(img.header.get_xyzt_units(), ('mm', 'sec'))

warnings.simplefilter('default')


class TestNifti1Image(TestNifti1Pair):
# Run analyze-flavor spatialimage tests
Expand Down

0 comments on commit 1da0097

Please sign in to comment.