@@ -113,11 +113,14 @@ def validate_affine(self, imaker, params):
113
113
def validate_affine_deprecated (self , imaker , params ):
114
114
# Check deprecated affine API
115
115
img = imaker ()
116
- assert_almost_equal (img .get_affine (), params ['affine' ], 6 )
117
- assert_equal (img .get_affine ().dtype , np .float64 )
118
- aff = img .get_affine ()
119
- aff [0 , 0 ] = 1.5
120
- assert_true (aff is img .get_affine ())
116
+ with clear_and_catch_warnings () as w :
117
+ warnings .simplefilter ('always' , DeprecationWarning )
118
+ assert_almost_equal (img .get_affine (), params ['affine' ], 6 )
119
+ assert_equal (len (w ), 1 )
120
+ assert_equal (img .get_affine ().dtype , np .float64 )
121
+ aff = img .get_affine ()
122
+ aff [0 , 0 ] = 1.5
123
+ assert_true (aff is img .get_affine ())
121
124
122
125
def validate_header (self , imaker , params ):
123
126
# Check header API
@@ -134,9 +137,9 @@ def validate_header(self, imaker, params):
134
137
135
138
def validate_header_deprecated (self , imaker , params ):
136
139
# Check deprecated header API
140
+ img = imaker ()
137
141
with clear_and_catch_warnings () as w :
138
142
warnings .simplefilter ('always' , DeprecationWarning )
139
- img = imaker ()
140
143
hdr = img .get_header ()
141
144
assert_equal (len (w ), 1 )
142
145
assert_true (hdr is img .header )
0 commit comments