Skip to content

Commit 1f1c20b

Browse files
committed
check first point is in correct timezone
1 parent 1d1eef2 commit 1f1c20b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

pandas/tests/mytest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import pandas as pd
2+
import numpy as np
3+
4+
def test_me():
5+
df = pd.DataFrame({'key1' : ['a', 'a', 'b', 'b', 'a'],
6+
'key2' : ['one', 'two', 'one', 'two', 'one'],
7+
'key3' : ['three', 'three', 'three', 'six', 'six'],
8+
'data1' : np.random.randn(5),
9+
'data2' : np.random.randn(5)})
10+
df.groupby('key1').min()

pandas/tests/plotting/test_datetimelike.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
""" Test cases for time series specific (freq conversion, etc) """
22
from datetime import date, datetime, time, timedelta
33
import pickle
4+
import re
45
import sys
56

67
import numpy as np
@@ -50,6 +51,14 @@ def test_ts_plot_with_tz(self, tz_aware_fixture):
5051
index = date_range("1/1/2011", periods=2, freq="H", tz=tz)
5152
ts = Series([188.5, 328.25], index=index)
5253
with tm.assert_produces_warning(None):
54+
fig, ax = self.plt.subplots()
55+
ts.plot(ax=ax)
56+
fig.canvas.draw()
57+
labels = [i.get_text() for i in ax.get_xticklabels()]
58+
# Extract H:M component, check first point is in correct timezone.
59+
# NOTE: this test could be updated once GH 31548 is fixed,
60+
# so that the last point is checked as well.
61+
assert re.findall(r"[^:]*(\d{2}:\d{2})", labels[0]) == ["00:00"]
5362
_check_plot_works(ts.plot)
5463

5564
def test_fontsize_set_correctly(self):

0 commit comments

Comments
 (0)