@@ -814,7 +814,7 @@ def test_to_period_2d(self, arr1d):
814
814
expected = arr1d .to_period ("D" ).reshape (1 , - 1 )
815
815
tm .assert_period_array_equal (result , expected )
816
816
817
- @pytest .mark .parametrize ("propname" , DatetimeIndex ._bool_ops )
817
+ @pytest .mark .parametrize ("propname" , DatetimeArray ._bool_ops )
818
818
def test_bool_properties (self , arr1d , propname ):
819
819
# in this case _bool_ops is just `is_leap_year`
820
820
dti = self .index_cls (arr1d )
@@ -826,16 +826,20 @@ def test_bool_properties(self, arr1d, propname):
826
826
827
827
tm .assert_numpy_array_equal (result , expected )
828
828
829
- @pytest .mark .parametrize ("propname" , DatetimeIndex ._field_ops )
829
+ @pytest .mark .parametrize ("propname" , DatetimeArray ._field_ops )
830
830
def test_int_properties (self , arr1d , propname ):
831
+ warn = None
832
+ msg = "weekofyear and week have been deprecated, please use"
831
833
if propname in ["week" , "weekofyear" ]:
832
834
# GH#33595 Deprecate week and weekofyear
833
- return
835
+ warn = FutureWarning
836
+
834
837
dti = self .index_cls (arr1d )
835
838
arr = arr1d
836
839
837
- result = getattr (arr , propname )
838
- expected = np .array (getattr (dti , propname ), dtype = result .dtype )
840
+ with tm .assert_produces_warning (warn , match = msg ):
841
+ result = getattr (arr , propname )
842
+ expected = np .array (getattr (dti , propname ), dtype = result .dtype )
839
843
840
844
tm .assert_numpy_array_equal (result , expected )
841
845
@@ -979,7 +983,7 @@ def test_total_seconds(self, timedelta_index):
979
983
980
984
tm .assert_numpy_array_equal (result , expected .values )
981
985
982
- @pytest .mark .parametrize ("propname" , TimedeltaIndex ._field_ops )
986
+ @pytest .mark .parametrize ("propname" , TimedeltaArray ._field_ops )
983
987
def test_int_properties (self , timedelta_index , propname ):
984
988
tdi = timedelta_index
985
989
arr = TimedeltaArray (tdi )
0 commit comments