code: def test_preprocess_setup_raises_negative_no_exo(
      load_pos_and_neg_data, method
  ):
      """Tests setup conditions that raise errors due to negative values before
      transformatons. Univariate without exogenous variables"""
  
      continue_ = _continue_negative_value_checks(method=method)
      if continue_:
          data = load_pos_and_neg_data
  
          exp = TSForecastingExperiment()
  
          with pytest.raises(ValueError) as errmsg:
              exp.setup(data=data, transform_target=method)
          exceptionmsg = errmsg.value.args[0]
          # The first message is given when then the transformation produced NA values
          # and the underlying model can handle missing data (in this case, the sktime
          # checks pass but pycaret checks fail)
          # The second message is given the transformation produces NA values and the
          # underlying model can not handle missing data (in this case, the sktime checks
          # fail and the pycaret checks are not reached.)
          assert (
              "This can happen when you have negative and/or zero values in the data"
              or "DummyForecaster cannot handle missing data (nans), but y passed contained missing data"
              in exceptionmsg
          )
  
imports: import os
  import numpy
  import pytest
  import sktime
  from packaging import version
  from sktime.forecasting.compose import ForecastingPipeline, TransformedTargetForecaster
  from time_series_test_utils import _IMPUTE_METHODS_STR, _SCALE_METHODS, _TRANSFORMATION_METHODS, _TRANSFORMATION_METHODS_NO_NEG, _return_model_names_for_missing_data
  from pycaret.time_series import TSForecastingExperiment
label_desc: Use image node_id 6 for calling a global function with example usage: test_preprocess_setup_raises_negative_no_exo(load_pos_and_neg_data, method) without return types