@@ -1208,7 +1208,7 @@ def test_zooms_edge_cases(self):
1208
1208
1209
1209
1210
1210
# Unknown units = 2 warnings
1211
- with warnings . catch_warnings ( record = True ) as warns :
1211
+ with clear_and_catch_warnings ( ) as warns :
1212
1212
warnings .simplefilter ('always' )
1213
1213
assert_array_almost_equal (img .header .get_zooms (units = 'canonical' ),
1214
1214
(1 , 1 , 1 , 1 ))
@@ -1217,7 +1217,7 @@ def test_zooms_edge_cases(self):
1217
1217
units = 'canonical' , raise_unknown = True )
1218
1218
1219
1219
img .header .set_xyzt_units (xyz = 'meter' )
1220
- with warnings . catch_warnings ( record = True ) as warns :
1220
+ with clear_and_catch_warnings ( ) as warns :
1221
1221
warnings .simplefilter ('always' )
1222
1222
assert_array_almost_equal (img .header .get_zooms (units = 'canonical' ),
1223
1223
(1000 , 1000 , 1000 , 1 ))
@@ -1233,7 +1233,7 @@ def test_zooms_edge_cases(self):
1233
1233
(0.001 , 0.001 , 0.001 , 1 ))
1234
1234
1235
1235
img .header .set_xyzt_units (t = 'sec' )
1236
- with warnings . catch_warnings ( record = True ) as warns :
1236
+ with clear_and_catch_warnings ( ) as warns :
1237
1237
warnings .simplefilter ('always' )
1238
1238
assert_array_equal (img .header .get_zooms (units = 'canonical' ),
1239
1239
(1 , 1 , 1 , 1 ))
0 commit comments