@@ -530,23 +530,19 @@ def test_find_nearest_contour():
530530 img = np .exp (- np .pi * (np .sum ((xy - 5 )** 2 , 0 )/ 5. ** 2 ))
531531 cs = plt .contour (img , 10 )
532532
533- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ):
534- nearest_contour = cs .find_nearest_contour (1 , 1 , pixel = False )
533+ nearest_contour = cs .find_nearest_contour (1 , 1 , pixel = False )
535534 expected_nearest = (1 , 0 , 33 , 1.965966 , 1.965966 , 1.866183 )
536535 assert_array_almost_equal (nearest_contour , expected_nearest )
537536
538- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ):
539- nearest_contour = cs .find_nearest_contour (8 , 1 , pixel = False )
537+ nearest_contour = cs .find_nearest_contour (8 , 1 , pixel = False )
540538 expected_nearest = (1 , 0 , 5 , 7.550173 , 1.587542 , 0.547550 )
541539 assert_array_almost_equal (nearest_contour , expected_nearest )
542540
543- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ):
544- nearest_contour = cs .find_nearest_contour (2 , 5 , pixel = False )
541+ nearest_contour = cs .find_nearest_contour (2 , 5 , pixel = False )
545542 expected_nearest = (3 , 0 , 21 , 1.884384 , 5.023335 , 0.013911 )
546543 assert_array_almost_equal (nearest_contour , expected_nearest )
547544
548- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ):
549- nearest_contour = cs .find_nearest_contour (2 , 5 , indices = (5 , 7 ), pixel = False )
545+ nearest_contour = cs .find_nearest_contour (2 , 5 , indices = (5 , 7 ), pixel = False )
550546 expected_nearest = (5 , 0 , 16 , 2.628202 , 5.0 , 0.394638 )
551547 assert_array_almost_equal (nearest_contour , expected_nearest )
552548
@@ -556,16 +552,13 @@ def test_find_nearest_contour_no_filled():
556552 img = np .exp (- np .pi * (np .sum ((xy - 5 )** 2 , 0 )/ 5. ** 2 ))
557553 cs = plt .contourf (img , 10 )
558554
559- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ), \
560- pytest .raises (ValueError , match = "Method does not support filled contours" ):
555+ with pytest .raises (ValueError , match = "Method does not support filled contours" ):
561556 cs .find_nearest_contour (1 , 1 , pixel = False )
562557
563- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ), \
564- pytest .raises (ValueError , match = "Method does not support filled contours" ):
558+ with pytest .raises (ValueError , match = "Method does not support filled contours" ):
565559 cs .find_nearest_contour (1 , 10 , indices = (5 , 7 ), pixel = False )
566560
567- with pytest .warns (mpl ._api .MatplotlibDeprecationWarning ), \
568- pytest .raises (ValueError , match = "Method does not support filled contours" ):
561+ with pytest .raises (ValueError , match = "Method does not support filled contours" ):
569562 cs .find_nearest_contour (2 , 5 , indices = (2 , 7 ), pixel = True )
570563
571564
@@ -825,12 +818,11 @@ def test_allsegs_allkinds():
825818
826819 cs = plt .contour (x , y , z , levels = [0 , 0.5 ])
827820
828- # Expect two levels, first with 5 segments and the second with 4.
829- with pytest .warns (PendingDeprecationWarning , match = "all" ):
830- for result in [cs .allsegs , cs .allkinds ]:
831- assert len (result ) == 2
832- assert len (result [0 ]) == 5
833- assert len (result [1 ]) == 4
821+ # Expect two levels, the first with 5 segments and the second with 4.
822+ for result in [cs .allsegs , cs .allkinds ]:
823+ assert len (result ) == 2
824+ assert len (result [0 ]) == 5
825+ assert len (result [1 ]) == 4
834826
835827
836828def test_deprecated_apis ():
0 commit comments