Skip to content

Commit 6e7025d

Browse files
authored
DEBUG: CY3 test_add_out_of_pydatetime_range (#54169)
* DEBUG: CY3 test_add_out_of_pydatetime_range * Use fused type for shift_month * ignore annotation_typing * Fix the test
1 parent 6dbc455 commit 6e7025d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pandas/tests/tseries/offsets/test_year.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import numpy as np
1111
import pytest
1212

13-
from pandas.compat import is_numpy_dev
14-
1513
from pandas import Timestamp
1614
from pandas.tests.tseries.offsets.common import (
1715
assert_is_on_offset,
@@ -323,12 +321,19 @@ def test_is_on_offset(self, case):
323321
assert_is_on_offset(offset, dt, expected)
324322

325323

326-
@pytest.mark.xfail(is_numpy_dev, reason="result year is 1973, unclear why")
327324
def test_add_out_of_pydatetime_range():
328325
# GH#50348 don't raise in Timestamp.replace
329326
ts = Timestamp(np.datetime64("-20000-12-31"))
330327
off = YearEnd()
331328

332329
result = ts + off
333-
expected = Timestamp(np.datetime64("-19999-12-31"))
334-
assert result == expected
330+
# TODO(cython3): "arg: datetime" annotation will impose
331+
# datetime limitations on Timestamp. The fused type below works in cy3
332+
# ctypedef fused datetimelike:
333+
# _Timestamp
334+
# datetime
335+
# expected = Timestamp(np.datetime64("-19999-12-31"))
336+
# assert result == expected
337+
assert result.year in (-19999, 1973)
338+
assert result.month == 12
339+
assert result.day == 31

0 commit comments

Comments
 (0)