Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dcc71f1

Browse files
committed
TEST: Fix warnings
1 parent bddf15c commit dcc71f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎nibabel/tests/test_nifti1.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def test_freesurfer_ico7_hack(self):
349349
nii2 = load('test.nii')
350350
assert_equal(nii.shape, nii2.shape)
351351
assert_array_equal(nii.get_data(), nii2.get_data())
352-
assert_array_equal(nii.get_affine(), nii2.get_affine())
352+
assert_array_equal(nii.affine, nii2.affine)
353353

354354
def test_qform_sform(self):
355355
HC = self.header_class
@@ -1036,15 +1036,18 @@ def test_norm_zooms_edge_cases(self):
10361036
aff = np.eye(4)
10371037
img = img_klass(arr, aff)
10381038

1039+
10391040
# Unknown units = 2 warnings
10401041
with warnings.catch_warnings(record=True) as warns:
1042+
warnings.simplefilter('always')
10411043
assert_array_almost_equal(img.header.get_norm_zooms(),
10421044
(1, 1, 1, 1))
10431045
assert_equal(len(warns), 2)
10441046
assert_raises(ValueError, img.header.get_norm_zooms, True)
10451047

10461048
img.header.set_xyzt_units(xyz='meter')
10471049
with warnings.catch_warnings(record=True) as warns:
1050+
warnings.simplefilter('always')
10481051
assert_array_almost_equal(img.header.get_norm_zooms(),
10491052
(1000, 1000, 1000, 1))
10501053
assert_equal(len(warns), 1)
@@ -1059,6 +1062,7 @@ def test_norm_zooms_edge_cases(self):
10591062

10601063
img.header.set_xyzt_units(t='sec')
10611064
with warnings.catch_warnings(record=True) as warns:
1065+
warnings.simplefilter('always')
10621066
assert_array_equal(img.header.get_norm_zooms(), (1, 1, 1, 1))
10631067
assert_equal(len(warns), 1)
10641068
assert_raises(ValueError, img.header.get_norm_zooms, True)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /