def test_optional_static_covariates(self, model_cls):
        """adding static covariates to lagged data logic is tested in
        `darts.tests.utils.data.tabularization.test_add_static_covariates`
        """
        series = (
            tg.linear_timeseries(length=6)
            .with_static_covariates(pd.DataFrame({"a": [1]}))
            .astype(np.float32)
        )
        # training model with static covs and predicting without will raise an error
        model = model_cls(lags=4, use_static_covariates=True)
        model.fit(series)
        assert model.uses_static_covariates
        assert model._static_covariates_shape == series.static_covariates.shape
        with pytest.raises(ValueError):
            model.predict(n=2, series=series.with_static_covariates(None))

        # with `use_static_covariates=True`, all series must have static covs
        model = model_cls(lags=4, use_static_covariates=True)
        with pytest.raises(ValueError):
            model.fit([series, series.with_static_covariates(None)])

        # with `use_static_covariates=True`, all static covs must have same shape
        model = model_cls(lags=4, use_static_covariates=True)
        with pytest.raises(ValueError):
            model.fit([
                series,
                series.with_static_covariates(pd.DataFrame({"a": [1], "b": [2]})),
            ])

        # with `use_static_covariates=False`, static covariates are ignored and prediction works
        model = model_cls(lags=4, use_static_covariates=False)
        model.fit(series)
        assert not model.uses_static_covariates
        assert model._static_covariates_shape is None
        preds = model.predict(n=2, series=series.with_static_covariates(None))
        assert preds.static_covariates is None

        # with `use_static_covariates=False`, static covariates are ignored and prediction works
        model = model_cls(lags=4, use_static_covariates=False)
        model.fit(series.with_static_covariates(None))
        assert not model.uses_static_covariates
        assert model._static_covariates_shape is None
        preds = model.predict(n=2, series=series)
        np.testing.assert_almost_equal(
            preds.static_covariates.values,
            series.static_covariates.values,
        )

        # with `use_static_covariates=True`, static covariates are included
        model = model_cls(lags=4, use_static_covariates=True)
        model.fit([series, series])
        assert model.uses_static_covariates
        assert model._static_covariates_shape == series.static_covariates.shape
        preds = model.predict(n=2, series=[series, series])
        for pred in preds:
            np.testing.assert_almost_equal(
                pred.static_covariates.values,
                series.static_covariates.values,
            )
adding static covariates to lagged data logic is tested in
        `darts.tests.utils.data.tabularization.test_add_static_covariates`
        
darts/tests/models/forecasting/test_sklearn_models.py