@@ -1131,7 +1131,7 @@ def test_zooms_edge_cases(self):
1131
1131
1132
1132
1133
1133
# Unknown units = 2 warnings
1134
- with warnings . catch_warnings ( record = True ) as warns :
1134
+ with clear_and_catch_warnings ( ) as warns :
1135
1135
warnings .simplefilter ('always' )
1136
1136
assert_array_almost_equal (img .header .get_zooms (units = 'canonical' ),
1137
1137
(1 , 1 , 1 , 1 ))
@@ -1140,7 +1140,7 @@ def test_zooms_edge_cases(self):
1140
1140
units = 'canonical' , raise_unknown = True )
1141
1141
1142
1142
img .header .set_xyzt_units (xyz = 'meter' )
1143
- with warnings . catch_warnings ( record = True ) as warns :
1143
+ with clear_and_catch_warnings ( ) as warns :
1144
1144
warnings .simplefilter ('always' )
1145
1145
assert_array_almost_equal (img .header .get_zooms (units = 'canonical' ),
1146
1146
(1000 , 1000 , 1000 , 1 ))
@@ -1156,7 +1156,7 @@ def test_zooms_edge_cases(self):
1156
1156
(0.001 , 0.001 , 0.001 , 1 ))
1157
1157
1158
1158
img .header .set_xyzt_units (t = 'sec' )
1159
- with warnings . catch_warnings ( record = True ) as warns :
1159
+ with clear_and_catch_warnings ( ) as warns :
1160
1160
warnings .simplefilter ('always' )
1161
1161
assert_array_equal (img .header .get_zooms (units = 'canonical' ),
1162
1162
(1 , 1 , 1 , 1 ))
0 commit comments