Skip to content

Commit dc4bf8a

Browse files
TomAugspurgerharisbal
authored and
harisbal
committed
TST: Debug flaky plotting test (pandas-dev#19925)
1 parent 892dd3d commit dc4bf8a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pandas/tests/plotting/test_datetimelike.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -689,14 +689,17 @@ def test_mixed_freq_regular_first(self):
689689
s2 = s1[[0, 5, 10, 11, 12, 13, 14, 15]]
690690

691691
# it works!
692-
s1.plot()
692+
_, ax = self.plt.subplots()
693+
s1.plot(ax=ax)
693694

694-
ax2 = s2.plot(style='g')
695+
ax2 = s2.plot(style='g', ax=ax)
695696
lines = ax2.get_lines()
696697
idx1 = PeriodIndex(lines[0].get_xdata())
697698
idx2 = PeriodIndex(lines[1].get_xdata())
698-
assert idx1.equals(s1.index.to_period('B'))
699-
assert idx2.equals(s2.index.to_period('B'))
699+
700+
tm.assert_index_equal(idx1, s1.index.to_period('B'))
701+
tm.assert_index_equal(idx2, s2.index.to_period('B'))
702+
700703
left, right = ax2.get_xlim()
701704
pidx = s1.index.to_period()
702705
assert left <= pidx[0].ordinal

0 commit comments

Comments
 (0)