Skip to content

Commit cc68f8a

Browse files
committed
add a test
1 parent b709eff commit cc68f8a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pandas/tests/indexes/datetimes/test_date_range.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,31 @@ def test_data_range_custombusinessday_partial_time(self, unit):
12801280
)
12811281
tm.assert_index_equal(result, expected)
12821282

1283+
def test_cdaterange_cbh(self):
1284+
# GH#62849
1285+
result = bdate_range(
1286+
"2009-03-13",
1287+
"2009-03-15",
1288+
freq="cbh",
1289+
weekmask="Mon Wed Fri",
1290+
holidays=["2009-03-14"],
1291+
)
1292+
expected = DatetimeIndex(
1293+
[
1294+
"2009-03-13 09:00:00",
1295+
"2009-03-13 10:00:00",
1296+
"2009-03-13 11:00:00",
1297+
"2009-03-13 12:00:00",
1298+
"2009-03-13 13:00:00",
1299+
"2009-03-13 14:00:00",
1300+
"2009-03-13 15:00:00",
1301+
"2009-03-13 16:00:00",
1302+
],
1303+
dtype="datetime64[ns]",
1304+
freq="cbh",
1305+
)
1306+
tm.assert_index_equal(result, expected)
1307+
12831308

12841309
class TestDateRangeNonNano:
12851310
def test_date_range_reso_validation(self):

0 commit comments

Comments
 (0)