Skip to content

Commit 8e47971

Browse files
authored
check first and last points' labels are correct (#31659)
1 parent 531a430 commit 8e47971

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/plotting/test_datetimelike.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ def teardown_method(self, method):
4545

4646
@pytest.mark.slow
4747
def test_ts_plot_with_tz(self, tz_aware_fixture):
48-
# GH2877, GH17173, GH31205
48+
# GH2877, GH17173, GH31205, GH31580
4949
tz = tz_aware_fixture
5050
index = date_range("1/1/2011", periods=2, freq="H", tz=tz)
5151
ts = Series([188.5, 328.25], index=index)
5252
with tm.assert_produces_warning(None):
5353
_check_plot_works(ts.plot)
54+
ax = ts.plot()
55+
xdata = list(ax.get_lines())[0].get_xdata()
56+
# Check first and last points' labels are correct
57+
assert (xdata[0].hour, xdata[0].minute) == (0, 0)
58+
assert (xdata[-1].hour, xdata[-1].minute) == (1, 0)
5459

5560
def test_fontsize_set_correctly(self):
5661
# For issue #8765

0 commit comments

Comments
 (0)