@@ -530,23 +530,19 @@ def test_find_nearest_contour():
530
530
img = np .exp (- np .pi * (np .sum ((xy - 5 )** 2 , 0 )/ 5. ** 2 ))
531
531
cs = plt .contour (img , 10 )
532
532
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 )
535
534
expected_nearest = (1 , 0 , 33 , 1.965966 , 1.965966 , 1.866183 )
536
535
assert_array_almost_equal (nearest_contour , expected_nearest )
537
536
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 )
540
538
expected_nearest = (1 , 0 , 5 , 7.550173 , 1.587542 , 0.547550 )
541
539
assert_array_almost_equal (nearest_contour , expected_nearest )
542
540
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 )
545
542
expected_nearest = (3 , 0 , 21 , 1.884384 , 5.023335 , 0.013911 )
546
543
assert_array_almost_equal (nearest_contour , expected_nearest )
547
544
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 )
550
546
expected_nearest = (5 , 0 , 16 , 2.628202 , 5.0 , 0.394638 )
551
547
assert_array_almost_equal (nearest_contour , expected_nearest )
552
548
@@ -556,16 +552,13 @@ def test_find_nearest_contour_no_filled():
556
552
img = np .exp (- np .pi * (np .sum ((xy - 5 )** 2 , 0 )/ 5. ** 2 ))
557
553
cs = plt .contourf (img , 10 )
558
554
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" ):
561
556
cs .find_nearest_contour (1 , 1 , pixel = False )
562
557
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" ):
565
559
cs .find_nearest_contour (1 , 10 , indices = (5 , 7 ), pixel = False )
566
560
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" ):
569
562
cs .find_nearest_contour (2 , 5 , indices = (2 , 7 ), pixel = True )
570
563
571
564
@@ -825,12 +818,11 @@ def test_allsegs_allkinds():
825
818
826
819
cs = plt .contour (x , y , z , levels = [0 , 0.5 ])
827
820
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
834
826
835
827
836
828
def test_deprecated_apis ():
0 commit comments