def test_feature_times_series_too_short_error(self):
        """
        Tests that `_get_feature_times` throws correct error
        when provided series are too short for specified
        lag and/or `output_chunk_length` values.
        """
        series = linear_timeseries(start=1, length=2, freq=1)
        # `target_series` too short when predicting:
        with pytest.raises(ValueError) as err:
            _get_feature_times(target_series=series, lags=[-20, -1], is_training=False)
        assert (
            "`target_series` must have at least `-min(lags) + max(lags) + 1` = 20 "
            "time steps; instead, it only has 2."
        ) == str(err.value)
        # `target_series` too short when training:
        with pytest.raises(ValueError) as err:
            _get_feature_times(
                target_series=series,
                lags=[-20],
                output_chunk_length=5,
                is_training=True,
            )
        assert (
            "`target_series` must have at least `-min(lags) + output_chunk_length + output_chunk_shift` = 25 "
            "time steps; instead, it only has 2."
        ) == str(err.value)
        # `past_covariates` too short when training:
        with pytest.raises(ValueError) as err:
            _get_feature_times(
                target_series=series,
                past_covariates=series,
                lags_past_covariates=[-20, -1],
                output_chunk_length=1,
                is_training=True,
            )
        assert (
            "`past_covariates` must have at least "
            "`-min(lags_past_covariates) + max(lags_past_covariates) + 1` = 20 time steps; "
            "instead, it only has 2."
        ) == str(err.value)

        Tests that `_get_feature_times` throws correct error
        when provided series are too short for specified
        lag and/or `output_chunk_length` values.
        
darts/tests/utils/tabularization/test_get_feature_times.py