@@ -714,25 +714,29 @@ def test_quadmesh_alpha_array():
714
714
715
715
716
716
def test_alpha_validation ():
717
+ # Most of the relevant testing is in test_artist and test_colors.
717
718
fig , ax = plt .subplots ()
718
719
pc = ax .pcolormesh (np .arange (12 ).reshape ((3 , 4 )))
719
- with pytest .raises (TypeError , match = '^alpha must be numeric or None' ):
720
- pc .set_alpha ('string' )
721
- with pytest .raises (ValueError , match = "outside 0-1 range" ):
722
- pc .set_alpha (1.1 )
723
- with pytest .raises (ValueError , match = "outside 0-1 range" ):
724
- pc .set_alpha (np .nan )
725
- with pytest .raises (ValueError , match = "alpha must be between 0 and 1" ):
726
- pc .set_alpha ([0.5 , 1.1 ])
727
- with pytest .raises (ValueError , match = "alpha must be between 0 and 1" ):
728
- pc .set_alpha ([0.5 , np .nan ])
720
+ # with pytest.raises(TypeError, match='^alpha must be numeric or None'):
721
+ # pc.set_alpha('string')
722
+ # with pytest.raises(ValueError, match="outside 0-1 range"):
723
+ # pc.set_alpha(1.1)
724
+ # with pytest.raises(ValueError, match="outside 0-1 range"):
725
+ # pc.set_alpha(np.nan)
726
+ # with pytest.raises(ValueError, match="alpha must be between 0 and 1"):
727
+ # pc.set_alpha([0.5, 1.1])
728
+ # with pytest.raises(ValueError, match="alpha must be between 0 and 1"):
729
+ # pc.set_alpha([0.5, np.nan])
729
730
with pytest .raises (ValueError , match = "^Data array shape" ):
730
731
pc .set_alpha ([0.5 , 0.6 ])
731
732
pc .update_scalarmappable ()
732
- ax .cla ()
733
- sc = ax .scatter ([1 , 2 ], [1 , 2 ], color = ['r' , 'g' ])
734
- with pytest .raises (ValueError , match = "^The number of colors must match" ):
735
- sc .set_alpha ([0.5 , 0.5 , 0.5 ])
733
+ # sc = ax.scatter([1, 2], [1, 2], color=['r', 'g'])
734
+ # with pytest.raises(ValueError, match="alpha must be between 0 and 1"):
735
+ # sc.set_alpha([0.5, 1.1])
736
+ # with pytest.raises(ValueError, match="outside 0-1 range"):
737
+ # sc.set_alpha(1.1)
738
+ # with pytest.raises(ValueError, match="The number of colors must match"):
739
+ # sc.set_alpha([[1, 1, 1]])
736
740
737
741
738
742
def test_legend_inverse_size_label_relationship ():
0 commit comments