diff --git a/nibabel/tests/test_nifti1.py b/nibabel/tests/test_nifti1.py index 05b790bc78..42a0f0c5de 100644 --- a/nibabel/tests/test_nifti1.py +++ b/nibabel/tests/test_nifti1.py @@ -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 @@ -1036,8 +1036,10 @@ def test_norm_zooms_edge_cases(self): aff = np.eye(4) img = img_klass(arr, aff) + # Unknown units = 2 warnings with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') assert_array_almost_equal(img.header.get_norm_zooms(), (1, 1, 1, 1)) assert_equal(len(warns), 2) @@ -1045,6 +1047,7 @@ def test_norm_zooms_edge_cases(self): img.header.set_xyzt_units(xyz='meter') with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') assert_array_almost_equal(img.header.get_norm_zooms(), (1000, 1000, 1000, 1)) assert_equal(len(warns), 1) @@ -1059,6 +1062,7 @@ def test_norm_zooms_edge_cases(self): img.header.set_xyzt_units(t='sec') with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') assert_array_equal(img.header.get_norm_zooms(), (1, 1, 1, 1)) assert_equal(len(warns), 1) assert_raises(ValueError, img.header.get_norm_zooms, True)