@@ -847,40 +847,40 @@ def test_polycollection_joinstyle():
847
847
ax .set_ybound (0 , 3 )
848
848
849
849
850
- def test_fill_between_2d_x_input ():
851
- x = np .zeros ((2 , 2 ))
852
- y1 = 3
853
- y2 = 3
854
-
855
- fig = plt .figure ()
856
- ax = fig .add_subplot (211 )
857
- with pytest .raises (ValueError ):
858
- ax .plot (x , y1 , x , y2 , color = 'black' )
859
- ax .fill_between (x , y1 , y2 )
860
-
861
-
862
- def test_fill_between_2d_y1_input ():
863
- x = np .arange (0.0 , 2 , 0.02 )
864
- y1 = np .zeros ((2 , 2 ))
865
- y2 = 3
866
-
850
+ @pytest .mark .parametrize (
851
+ 'x, y1, y2' , [
852
+ (np .zeros ((2 , 2 )), 3 , 3 ),
853
+ (np .arange (0.0 , 2 , 0.02 ), np .zeros ((2 , 2 )), 3 ),
854
+ (np .arange (0.0 , 2 , 0.02 ), 3 , np .zeros ((2 , 2 )))
855
+ ], ids = [
856
+ '2d_x_input' ,
857
+ '2d_y1_input' ,
858
+ '2d_y2_input'
859
+ ]
860
+ )
861
+ def test_fill_between_input (x , y1 , y2 ):
867
862
fig = plt .figure ()
868
863
ax = fig .add_subplot (211 )
869
864
with pytest .raises (ValueError ):
870
- ax .plot (x , y1 , x , y2 , color = 'black' )
871
865
ax .fill_between (x , y1 , y2 )
872
866
873
867
874
- def test_fill_between_2d_y2_input ():
875
- x = np .arange (0.0 , 2 , 0.02 )
876
- y1 = 3
877
- y2 = np .zeros ((2 , 2 ))
878
-
868
+ @pytest .mark .parametrize (
869
+ 'y, x1, x2' , [
870
+ (np .zeros ((2 , 2 )), 3 , 3 ),
871
+ (np .arange (0.0 , 2 , 0.02 ), np .zeros ((2 , 2 )), 3 ),
872
+ (np .arange (0.0 , 2 , 0.02 ), 3 , np .zeros ((2 , 2 )))
873
+ ], ids = [
874
+ '2d_y_input' ,
875
+ '2d_x1_input' ,
876
+ '2d_x2_input'
877
+ ]
878
+ )
879
+ def test_fill_betweenx_input (y , x1 , x2 ):
879
880
fig = plt .figure ()
880
881
ax = fig .add_subplot (211 )
881
882
with pytest .raises (ValueError ):
882
- ax .plot (x , y1 , x , y2 , color = 'black' )
883
- ax .fill_between (x , y1 , y2 )
883
+ ax .fill_betweenx (y , x1 , x2 )
884
884
885
885
886
886
@image_comparison (baseline_images = ['fill_between_interpolate' ],
@@ -4995,42 +4995,6 @@ def test_tick_param_label_rotation():
4995
4995
assert text .get_rotation () == 90
4996
4996
4997
4997
4998
- def test_fill_betweenx_2d_y_input ():
4999
- y = np .zeros ((2 , 2 ))
5000
- x1 = 3
5001
- x2 = 3
5002
-
5003
- fig = plt .figure ()
5004
- ax = fig .add_subplot (211 )
5005
- with pytest .raises (ValueError ):
5006
- ax .plot (y , x1 , y , x2 , color = 'black' )
5007
- ax .fill_betweenx (y , x1 , x2 )
5008
-
5009
-
5010
- def test_fill_betweenx_2d_x1_input ():
5011
- y = np .arange (0.0 , 2 , 0.02 )
5012
- x1 = np .zeros ((2 , 2 ))
5013
- x2 = 3
5014
-
5015
- fig = plt .figure ()
5016
- ax = fig .add_subplot (211 )
5017
- with pytest .raises (ValueError ):
5018
- ax .plot (y , x1 , y , x2 , color = 'black' )
5019
- ax .fill_betweenx (y , x1 , x2 )
5020
-
5021
-
5022
- def test_fill_betweenx_2d_x2_input ():
5023
- y = np .arange (0.0 , 2 , 0.02 )
5024
- x1 = 3
5025
- x2 = np .zeros ((2 , 2 ))
5026
-
5027
- fig = plt .figure ()
5028
- ax = fig .add_subplot (211 )
5029
- with pytest .raises (ValueError ):
5030
- ax .plot (y , x1 , y , x2 , color = 'black' )
5031
- ax .fill_betweenx (y , x1 , x2 )
5032
-
5033
-
5034
4998
@pytest .mark .style ('default' )
5035
4999
def test_fillbetween_cycle ():
5036
5000
fig , ax = plt .subplots ()
0 commit comments