Skip to content

Commit 321ade0

Browse files
committed
Ignore week/weekofyear attributes in tests
1 parent 5581710 commit 321ade0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pandas/tests/indexes/datetimes/test_scalar_compat.py

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def test_dti_date_out_of_range(self, data):
4040
[
4141
"dayofweek",
4242
"dayofyear",
43-
"week",
44-
"weekofyear",
4543
"quarter",
4644
"days_in_month",
4745
"is_month_start",

pandas/tests/series/test_datetime_values.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_dt_namespace_accessor(self):
3636

3737
ok_for_period = PeriodArray._datetimelike_ops
3838
ok_for_period_methods = ["strftime", "to_timestamp", "asfreq"]
39-
ok_for_dt = DatetimeIndex._datetimelike_ops
39+
ok_for_dt = DatetimeIndex._datetimelike_ops + ["week", "weekofyear"]
4040
ok_for_dt_methods = [
4141
"to_period",
4242
"to_pydatetime",
@@ -50,8 +50,6 @@ def test_dt_namespace_accessor(self):
5050
"day_name",
5151
"month_name",
5252
"isocalendar",
53-
"week",
54-
"weekofyear",
5553
]
5654
ok_for_td = TimedeltaIndex._datetimelike_ops
5755
ok_for_td_methods = [
@@ -91,7 +89,8 @@ def compare(s, name):
9189
for s in cases:
9290
for prop in ok_for_dt:
9391
# we test freq below
94-
if prop != "freq":
92+
# we ignore week and weekofyear because they are deprecated
93+
if prop not in ["freq", "week", "weekofyear"]:
9594
compare(s, prop)
9695

9796
for prop in ok_for_dt_methods:
@@ -124,7 +123,8 @@ def compare(s, name):
124123
for prop in ok_for_dt:
125124

126125
# we test freq below
127-
if prop != "freq":
126+
# we ignore week and weekofyear because they are deprecated
127+
if prop not in ["freq", "week", "weekofyear"]:
128128
compare(s, prop)
129129

130130
for prop in ok_for_dt_methods:

0 commit comments

Comments
 (0)