Skip to content

Commit dc05b76

Browse files
Another regex fix
1 parent 0bf99e3 commit dc05b76

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/statespace/test_statespace.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,12 @@ def test_bad_forecast_arguments(use_datetime_index, caplog):
380380
time_idx = _make_time_idx(ss_mod, use_datetime_index)
381381

382382
# Start value not in time index
383-
with pytest.raises(
384-
ValueError, match="Integer start must be in the data index used to fit the model"
385-
):
383+
match = (
384+
"Datetime start must be in the data index used to fit the model"
385+
if use_datetime_index
386+
else "Integer start must be within the range of the data index used to fit the model."
387+
)
388+
with pytest.raises(ValueError, match=match):
386389
start = time_idx.shift(10)[-1] if use_datetime_index else time_idx[-1] + 11
387390
ss_mod._validate_forecast_args(time_index=time_idx, start=start, periods=10)
388391

0 commit comments

Comments
 (0)