@@ -6906,6 +6906,31 @@ def test_eventplot_legend():
69066906 plt .legend ()
69076907
69086908
6909+ @pytest .mark .parametrize ('err, args, kwargs, match' , (
6910+ (ValueError , [[1 ]], {'lineoffsets' : []}, 'lineoffsets cannot be empty' ),
6911+ (ValueError , [[1 ]], {'linelengths' : []}, 'linelengths cannot be empty' ),
6912+ (ValueError , [[1 ]], {'linewidths' : []}, 'linewidths cannot be empty' ),
6913+ (ValueError , [[1 ]], {'linestyles' : []}, 'linestyles cannot be empty' ),
6914+ (ValueError , [[1 ]], {'alpha' : []}, 'alpha cannot be empty' ),
6915+ (ValueError , [1 ], {}, 'positions must be one-dimensional' ),
6916+ (ValueError , [[1 ]], {'lineoffsets' : [1 , 2 ]},
6917+ 'lineoffsets and positions are unequal sized sequences' ),
6918+ (ValueError , [[1 ]], {'linelengths' : [1 , 2 ]},
6919+ 'linelengths and positions are unequal sized sequences' ),
6920+ (ValueError , [[1 ]], {'linewidths' : [1 , 2 ]},
6921+ 'linewidths and positions are unequal sized sequences' ),
6922+ (ValueError , [[1 ]], {'linestyles' : [1 , 2 ]},
6923+ 'linestyles and positions are unequal sized sequences' ),
6924+ (ValueError , [[1 ]], {'alpha' : [1 , 2 ]},
6925+ 'alpha and positions are unequal sized sequences' ),
6926+ (ValueError , [[1 ]], {'colors' : [1 , 2 ]},
6927+ 'colors and positions are unequal sized sequences' ),
6928+ ))
6929+ def test_eventplot_errors (err , args , kwargs , match ):
6930+ with pytest .raises (err , match = match ):
6931+ plt .eventplot (* args , ** kwargs )
6932+
6933+
69096934def test_bar_broadcast_args ():
69106935 fig , ax = plt .subplots ()
69116936 # Check that a bar chart with a single height for all bars works.
0 commit comments