Skip to content

Commit b394569

Browse files
Move and refactor unit test
1 parent 55087fb commit b394569

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pandas/tests/indexes/datetimes/test_datetime.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,3 @@ def test_asarray_tz_aware(self):
433433
result = np.asarray(idx, dtype=object)
434434

435435
tm.assert_numpy_array_equal(result, expected)
436-
437-
def test_apply_on_series(self):
438-
# GH 25959
439-
# Calling apply on a localized time series should not cause an error
440-
s = tm.makeTimeSeries()
441-
s = s.tz_localize('UTC')
442-
pd.Series(s.index).apply(lambda x: pd.Series([1, 2]))

pandas/tests/resample/test_datetime_index.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,3 +1488,13 @@ def test_get_timestamp_range_edges(first, last, offset,
14881488
result = _get_timestamp_range_edges(first, last, offset)
14891489
expected = (exp_first, exp_last)
14901490
assert result == expected
1491+
1492+
1493+
def test_apply_on_series():
1494+
# GH 25959
1495+
# Calling apply on a localized time series should not cause an error
1496+
index = pd.DatetimeIndex([1478064900001000000, 1480037118776792000])\
1497+
.tz_localize('UTC')
1498+
result = pd.Series(index).apply(lambda x: pd.Series([1, 2]))
1499+
expected = pd.DataFrame([[1, 2], [1, 2]])
1500+
assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)