code: def test_create_train_X_y_ValueError_when_len_y_is_less_than_window_size():
      """
      Test ValueError is raised when length of y is less than self.window_size + 1.
      """
      forecaster = ForecasterAutoregCustom(
          regressor=LinearRegression(),
          fun_predictors=create_predictors,
          window_size=10,
      )
  
      err_msg = re.escape(
          (
              f"`y` must have as many values as the windows_size needed by "
              f"{forecaster.fun_predictors.__name__}. For this Forecaster the "
              f"minimum length is {forecaster.window_size + 1}"
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          forecaster.create_train_X_y(y=pd.Series(np.arange(5)))
  
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.preprocessing import TimeSeriesDifferentiator
  from skforecast.exceptions import MissingValuesExogWarning
  from sklearn.linear_model import LinearRegression
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import StandardScaler
  from sklearn.preprocessing import OneHotEncoder
  from .fixtures_ForecasterAutoregCustom import data
label_desc: Use image node_id 4 for calling a global function with example usage: test_create_train_X_y_ValueError_when_len_y_is_less_than_window_size() without return types