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`."
            )
Passing unsupported covariate should raise an exception
darts/tests/models/forecasting/test_backtesting.py