@@ -1131,7 +1131,7 @@ def test_zooms_edge_cases(self):
11311131
11321132
11331133 # Unknown units = 2 warnings
1134- with warnings . catch_warnings ( record = True ) as warns :
1134+ with clear_and_catch_warnings ( ) as warns :
11351135 warnings .simplefilter ('always' )
11361136 assert_array_almost_equal (img .header .get_zooms (units = 'canonical' ),
11371137 (1 , 1 , 1 , 1 ))
@@ -1140,7 +1140,7 @@ def test_zooms_edge_cases(self):
11401140 units = 'canonical' , raise_unknown = True )
11411141
11421142 img .header .set_xyzt_units (xyz = 'meter' )
1143- with warnings . catch_warnings ( record = True ) as warns :
1143+ with clear_and_catch_warnings ( ) as warns :
11441144 warnings .simplefilter ('always' )
11451145 assert_array_almost_equal (img .header .get_zooms (units = 'canonical' ),
11461146 (1000 , 1000 , 1000 , 1 ))
@@ -1156,7 +1156,7 @@ def test_zooms_edge_cases(self):
11561156 (0.001 , 0.001 , 0.001 , 1 ))
11571157
11581158 img .header .set_xyzt_units (t = 'sec' )
1159- with warnings . catch_warnings ( record = True ) as warns :
1159+ with clear_and_catch_warnings ( ) as warns :
11601160 warnings .simplefilter ('always' )
11611161 assert_array_equal (img .header .get_zooms (units = 'canonical' ),
11621162 (1 , 1 , 1 , 1 ))
0 commit comments