33""" Test cases for DataFrame.plot """
44
55from datetime import date , datetime
6+ import itertools
67import string
78import warnings
89
@@ -2604,12 +2605,6 @@ def test_errorbar_plot(self):
26042605 ax = _check_plot_works (df .plot , yerr = np .ones ((2 , 12 )) * 0.4 )
26052606 self ._check_has_errorbars (ax , xerr = 0 , yerr = 2 )
26062607
2607- # yerr is iterator
2608- import itertools
2609-
2610- ax = _check_plot_works (df .plot , yerr = itertools .repeat (0.1 , len (df )))
2611- self ._check_has_errorbars (ax , xerr = 0 , yerr = 2 )
2612-
26132608 # yerr is column name
26142609 for yerr in ["yerr" , "誤差" ]:
26152610 s_df = df .copy ()
@@ -2626,6 +2621,17 @@ def test_errorbar_plot(self):
26262621 with pytest .raises ((ValueError , TypeError )):
26272622 df .plot (yerr = df_err )
26282623
2624+ @pytest .mark .xfail (reason = "Iterator is consumed" , raises = ValueError )
2625+ @pytest .mark .slow
2626+ def test_errorbar_plot_iterator (self ):
2627+ with warnings .catch_warnings ():
2628+ d = {"x" : np .arange (12 ), "y" : np .arange (12 , 0 , - 1 )}
2629+ df = DataFrame (d )
2630+
2631+ # yerr is iterator
2632+ ax = _check_plot_works (df .plot , yerr = itertools .repeat (0.1 , len (df )))
2633+ self ._check_has_errorbars (ax , xerr = 0 , yerr = 2 )
2634+
26292635 @pytest .mark .slow
26302636 def test_errorbar_with_integer_column_names (self ):
26312637 # test with integer column names
0 commit comments