def test_lagged_prediction_data_extend_past_and_future_covariates(self, config):
        """
        Tests that `create_lagged_prediction_data` correctly handles case where features
        can be created for a time that is *not* contained in `target_series`, `past_covariates`
        and/or `future_covariates`.

        More specifically, we define the series and lags such that a prediction feature
        can be generated for time `target.end_time() + target.freq`, even though this time
        isn't contained in any of the define series.
        """
        series_type, use_moving_windows = config
        if series_type == "integer":
            # Can create feature for time `t = 9`, but this time isn't in any of the three series:
            target = linear_timeseries(start=0, end=9, start_value=1, end_value=2)
            past = linear_timeseries(start=0, end=8, start_value=2, end_value=3)
            future = linear_timeseries(start=0, end=6, start_value=3, end_value=4)
        else:
            # Can create feature for time `t = '1/10/2000'`, but this time isn't in any of the three series:
            target = linear_timeseries(
                start=pd.Timestamp("1/1/2000"),
                end=pd.Timestamp("1/10/2000"),
                start_value=1,
                end_value=2,
            )
            past = linear_timeseries(
                start=pd.Timestamp("1/1/2000"),
                end=pd.Timestamp("1/9/2000"),
                start_value=2,
                end_value=3,
            )
            future = linear_timeseries(
                start=pd.Timestamp("1/1/2000"),
                end=pd.Timestamp("1/7/2000"),
                start_value=3,
                end_value=4,
            )

        lags = [-1]
        lags_past = [-2]
        lags_future = [-4]
        # Only want to check very last generated observation:
        max_samples_per_ts = 1
        # Expect `X` to be constructed from the very last values of each series:
        expected_X = np.concatenate([
            target.all_values(copy=False)[-1, :, 0],
            past.all_values(copy=False)[-1, :, 0],
            future.all_values(copy=False)[-1, :, 0],
        ]).reshape(1, -1)
        # Check correctness for both 'moving window' method
        # and 'time intersection' method:
        X, times = create_lagged_prediction_data(
            target,
            past_covariates=past,
            future_covariates=future,
            lags=lags,
            lags_past_covariates=lags_past,
            lags_future_covariates=lags_future,
            uses_static_covariates=False,
            max_samples_per_ts=max_samples_per_ts,
            use_moving_windows=use_moving_windows,
        )
        assert times[0][0] == target.end_time() + target.freq
        assert np.allclose(expected_X, X[:, :, 0])

        Tests that `create_lagged_prediction_data` correctly handles case where features
        can be created for a time that is *not* contained in `target_series`, `past_covariates`
        and/or `future_covariates`.

        More specifically, we define the series and lags such that a prediction feature
        can be generated for time `target.end_time() + target.freq`, even though this time
        isn't contained in any of the define series.
        
darts/tests/utils/tabularization/test_create_lagged_prediction_data.py