@@ -5788,13 +5788,18 @@ def test_set_ticks_with_labels(fig_test, fig_ref):
57885788 ax .set_yticks ([2 , 4 ], ['A' , 'B' ], minor = True )
57895789
57905790
5791- def test_set_noniterable_ticklabels ():
5792- # Ensure a useful TypeError message is raised
5793- # when given a non-iterable ticklabels argument
5794- # Pull request #22710
5791+ def test_xticks_bad_args ():
5792+ ax = plt .figure ().add_subplot ()
57955793 with pytest .raises (TypeError , match = 'must be a sequence' ):
5796- fig , ax = plt .subplots (2 )
5797- ax [1 ].set_xticks ([2 , 9 ], 3.1 )
5794+ ax .set_xticks ([2 , 9 ], 3.1 )
5795+ with pytest .raises (ValueError , match = 'must be 1D' ):
5796+ plt .xticks (np .arange (4 ).reshape ((- 1 , 1 )))
5797+ with pytest .raises (ValueError , match = 'must be 1D' ):
5798+ plt .xticks (np .arange (4 ).reshape ((1 , - 1 )))
5799+ with pytest .raises (ValueError , match = 'must be 1D' ):
5800+ plt .xticks (np .arange (4 ).reshape ((- 1 , 1 )), labels = range (4 ))
5801+ with pytest .raises (ValueError , match = 'must be 1D' ):
5802+ plt .xticks (np .arange (4 ).reshape ((1 , - 1 )), labels = range (4 ))
57985803
57995804
58005805def test_subsampled_ticklabels ():
0 commit comments