@@ -288,8 +288,9 @@ def test_contourf_decreasing_levels():
288288 # Legacy contouring algorithm gives a warning rather than raising an error,
289289 # plus a DeprecationWarning.
290290 with warnings .catch_warnings (record = True ) as w :
291+ warnings .simplefilter ("always" )
291292 plt .contourf (z , [1.0 , 0.0 ], corner_mask = 'legacy' )
292- assert_equal (len (w ), 2 )
293+ assert_equal (len (w ), 2 )
293294
294295
295296@cleanup
@@ -299,16 +300,18 @@ def test_vminvmax_warning():
299300 cs = plt .contourf (z , [0.0 , 1.0 ])
300301
301302 with warnings .catch_warnings (record = True ) as w :
303+ warnings .simplefilter ("always" )
302304 cs .vmin
303- assert len (w ) == 1
304- assert ( str ( w [ 0 ]. message ). startswith (
305- ( "vmin is deprecated and will be removed in 2.2 " )) )
305+ assert len (w ) == 1
306+ msg = "vmin is deprecated and will be removed in 2.2 "
307+ assert str ( w [ 0 ]. message ). startswith ( msg )
306308
307309 with warnings .catch_warnings (record = True ) as w :
310+ warnings .simplefilter ("always" )
308311 cs .vmax
309- assert len (w ) == 1
310- assert ( str ( w [ 0 ]. message ). startswith (
311- ( "vmax is deprecated and will be removed in 2.2 " )) )
312+ assert len (w ) == 1
313+ msg = "vmax is deprecated and will be removed in 2.2 "
314+ assert str ( w [ 0 ]. message ). startswith ( msg )
312315
313316
314317if __name__ == '__main__' :
0 commit comments