Skip to content

Commit 13d45f1

Browse files
committed
Add isocalendar test to replace removed week/weekofyear tests
1 parent ff65f67 commit 13d45f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/indexes/datetimes/test_scalar_compat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def test_dti_timestamp_fields(self, field):
5757
result = getattr(Timestamp(idx[-1]), field)
5858
assert result == expected
5959

60+
def test_dti_timestamp_isocalendar_fields(self):
61+
idx = tm.makeDateIndex(100)
62+
expected = tuple(idx.isocalendar().iloc[-1].to_list())
63+
result = idx[-1].isocalendar()
64+
assert result == expected
65+
6066
def test_dti_timestamp_freq_fields(self):
6167
# extra fields from DatetimeIndex like quarter and week
6268
idx = tm.makeDateIndex(100)

0 commit comments

Comments
 (0)