Skip to content

Commit

Permalink
TST: Debug flaky plotting test (pandas-dev#19925)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger authored and harisbal committed Feb 28, 2018
1 parent 892dd3d commit dc4bf8a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,17 @@ def test_mixed_freq_regular_first(self):
s2 = s1[[0, 5, 10, 11, 12, 13, 14, 15]]

# it works!
s1.plot()
_, ax = self.plt.subplots()
s1.plot(ax=ax)

ax2 = s2.plot(style='g')
ax2 = s2.plot(style='g', ax=ax)
lines = ax2.get_lines()
idx1 = PeriodIndex(lines[0].get_xdata())
idx2 = PeriodIndex(lines[1].get_xdata())
assert idx1.equals(s1.index.to_period('B'))
assert idx2.equals(s2.index.to_period('B'))

tm.assert_index_equal(idx1, s1.index.to_period('B'))
tm.assert_index_equal(idx2, s2.index.to_period('B'))

left, right = ax2.get_xlim()
pidx = s1.index.to_period()
assert left <= pidx[0].ordinal
Expand Down

0 comments on commit dc4bf8a

Please sign in to comment.