docstr: Passing unsupported covariate should raise an exception
docstr_tok: ["Passing","unsupported","covariate","should","raise","an","exception"]
code: def test_gridsearch_bad_covariates(self, model_cls, parameters):
      """Passing unsupported covariate should raise an exception"""
      dummy_series = get_dummy_series(
          ts_length=100, lt_end_value=1, st_value_offset=0
      ).astype(np.float32)
  
      ts_train, ts_val = dummy_series.split_before(split_point=0.8)
  
      bt_kwargs = {
          "start": -1,
          "start_format": "position",
          "show_warnings": False,
      }
  
      model = model_cls()
      model_cls.gridsearch(
          parameters=parameters,
          series=ts_train,
          val_series=ts_val,
          **bt_kwargs,
      )
  
      with pytest.raises(ValueError) as msg:
          model_cls.gridsearch(
              parameters=parameters,
              series=ts_train,
              past_covariates=dummy_series,
              val_series=ts_val,
              **bt_kwargs,
          )
      assert str(msg.value).startswith(
          "Model cannot be fit/trained with `past_covariates`."
      )
      if not model.supports_future_covariates:
          with pytest.raises(ValueError) as msg:
              model_cls.gridsearch(
                  parameters=parameters,
                  series=ts_train,
                  future_covariates=dummy_series,
                  val_series=ts_val,
                  **bt_kwargs,
              )
          assert str(msg.value).startswith(
              "Model cannot be fit/trained with `future_covariates`."
          )
  
imports: import random
  from itertools import product
  import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.datasets import AirPassengersDataset, MonthlyMilkDataset
  from darts.logging import get_logger
  from darts.metrics import mape, r2_score
  from darts.models import ARIMA, FFT, ExponentialSmoothing, NaiveDrift, NaiveSeasonal, Theta
  from darts.tests.conftest import tfm_kwargs
  from darts.utils.timeseries_generation import gaussian_timeseries
  from darts.utils.timeseries_generation import linear_timeseries
  from darts.utils.timeseries_generation import random_walk_timeseries
  from darts.utils.timeseries_generation import sine_timeseries
label_desc: Use image node_id 12 for calling the TestBacktesting obj's underlying member method code with example usage: obj.test_gridsearch_bad_covariates(model_cls, parameters) without return types