File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -779,18 +779,20 @@ def test_nonfinite_limits():
779
779
ax .plot (x , y )
780
780
781
781
782
- def test_limits_empty_data ():
782
+ @pytest .mark .parametrize ('plot_fun, lims' ,
783
+ [[plt .plot , (14610.0 , 14974.0 )],
784
+ [plt .scatter , (14591.8 , 14992.2 )]])
785
+ def test_limits_empty_data (plot_fun , lims ):
783
786
# Check that plotting empty data doesn't change autoscaling of dates
784
787
x = np .arange ("2010-01-01" , "2011-01-01" , dtype = "datetime64[D]" )
785
- lims = (14591.8 , 14992.2 )
786
788
787
789
fig , ax = plt .subplots ()
788
- ax . scatter (x , np .arange (len (x )))
790
+ plot_fun (x , np .arange (len (x )))
789
791
assert ax .get_xlim () == lims
790
792
791
793
fig , ax = plt .subplots ()
792
- ax . scatter ([], [])
793
- ax . scatter (x , np .arange (len (x )))
794
+ plot_fun ([], [])
795
+ plot_fun (x , np .arange (len (x )))
794
796
assert ax .get_xlim () == lims
795
797
796
798
You can’t perform that action at this time.
0 commit comments