Skip to content

Commit 5ec3b2f

Browse files
jschendelNico Cernek
authored and
Nico Cernek
committed
TST: Move datetime specific test from common tests (pandas-dev#28801)
1 parent 498556a commit 5ec3b2f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pandas/tests/indexes/common.py

-8
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ def test_to_frame(self, name):
9696
df = idx.to_frame(index=False, name=idx_name)
9797
assert df.index is not idx
9898

99-
def test_to_frame_datetime_tz(self):
100-
# GH 25809
101-
idx = pd.date_range(start="2019-01-01", end="2019-01-30", freq="D")
102-
idx = idx.tz_localize("UTC")
103-
result = idx.to_frame()
104-
expected = pd.DataFrame(idx, index=idx)
105-
tm.assert_frame_equal(result, expected)
106-
10799
def test_shift(self):
108100

109101
# GH8083 test the base class for shift

pandas/tests/indexes/datetimes/test_datetime.py

+7
Original file line numberDiff line numberDiff line change
@@ -450,3 +450,10 @@ def test_asarray_tz_aware(self):
450450
result = np.asarray(idx, dtype=object)
451451

452452
tm.assert_numpy_array_equal(result, expected)
453+
454+
def test_to_frame_datetime_tz(self):
455+
# GH 25809
456+
idx = date_range(start="2019-01-01", end="2019-01-30", freq="D", tz="UTC")
457+
result = idx.to_frame()
458+
expected = DataFrame(idx, index=idx)
459+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)