Skip to content

Commit a8d505c

Browse files
committed
Add isocalendar test to replace removed week/weekofyear tests
1 parent 321ade0 commit a8d505c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/indexes/datetimes/test_scalar_compat.py

+6
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)