diff --git a/pandas/tests/tseries/offsets/test_custom_business_hour.py b/pandas/tests/tseries/offsets/test_custom_business_hour.py index c2b4e3c343c11..8bc06cdd45a50 100644 --- a/pandas/tests/tseries/offsets/test_custom_business_hour.py +++ b/pandas/tests/tseries/offsets/test_custom_business_hour.py @@ -308,3 +308,21 @@ def test_us_federal_holiday_with_datetime(self): result = t0 + bhour_us * 8 expected = Timestamp("2014-01-21 15:00:00") assert result == expected + + +@pytest.mark.parametrize( + "weekmask, expected_time, mult", + [ + ["Mon Tue Wed Thu Fri Sat", "2018-11-10 09:00:00", 10], + ["Tue Wed Thu Fri Sat", "2018-11-13 08:00:00", 18], + ], +) +def test_custom_businesshour_weekmask_and_holidays(weekmask, expected_time, mult): + # GH 23542 + holidays = ["2018-11-09"] + bh = CustomBusinessHour( + start="08:00", end="17:00", weekmask=weekmask, holidays=holidays + ) + result = Timestamp("2018-11-08 08:00") + mult * bh + expected = Timestamp(expected_time) + assert result == expected diff --git a/pandas/tests/tseries/offsets/test_offsets.py b/pandas/tests/tseries/offsets/test_offsets.py index f807a1fe729b1..0c79c0b64f4cd 100644 --- a/pandas/tests/tseries/offsets/test_offsets.py +++ b/pandas/tests/tseries/offsets/test_offsets.py @@ -795,21 +795,3 @@ def test_dateoffset_immutable(attribute): msg = "DateOffset objects are immutable" with pytest.raises(AttributeError, match=msg): setattr(offset, attribute, 5) - - -@pytest.mark.parametrize( - "weekmask, expected_time, mult", - [ - ["Mon Tue Wed Thu Fri Sat", "2018-11-10 09:00:00", 10], - ["Tue Wed Thu Fri Sat", "2018-11-13 08:00:00", 18], - ], -) -def test_custom_businesshour_weekmask_and_holidays(weekmask, expected_time, mult): - # GH 23542 - holidays = ["2018-11-09"] - bh = CustomBusinessHour( - start="08:00", end="17:00", weekmask=weekmask, holidays=holidays - ) - result = Timestamp("2018-11-08 08:00") + mult * bh - expected = Timestamp(expected_time) - assert result == expected