Skip to content

Commit 0570e1e

Browse files
committed
Adapt existing tests for arbitrary freq PeriodIndex
1 parent 53441fe commit 0570e1e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/plotting/test_datetimelike.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def check_format_of_first_point(ax, expected_string):
211211
@pytest.mark.slow
212212
def test_line_plot_period_series(self):
213213
for s in self.period_ser:
214-
_check_plot_works(s.plot, s.index.freq)
214+
_check_plot_works(s.plot, s.index.freq.rule_code)
215215

216216
@pytest.mark.slow
217217
def test_line_plot_datetime_series(self):
@@ -221,7 +221,8 @@ def test_line_plot_datetime_series(self):
221221
@pytest.mark.slow
222222
def test_line_plot_period_frame(self):
223223
for df in self.period_df:
224-
_check_plot_works(df.plot, df.index.freq)
224+
freq = df.index.asfreq(df.index.freq.rule_code).freq
225+
_check_plot_works(df.plot, freq)
225226

226227
@pytest.mark.slow
227228
def test_line_plot_datetime_frame(self):

0 commit comments

Comments
 (0)