code: def test_setup_raises():
      """Test the setup with exogenous variables when it raises errors"""
      length = 100
      data = pd.DataFrame(np.random.rand(length, 7))
      data.columns = "A B C D E F G".split()
  
      exp = TSForecastingExperiment()
  
      ##############################
      # Target Not Specified ####
      ##############################
      with pytest.raises(ValueError) as errmsg:
          exp.setup(data=data)
  
      exceptionmsg = errmsg.value.args[0]
  
      assert (
          exceptionmsg
          == f"Data has {len(data.columns)} columns, but the target has not been specified."
      )
  
      ################################
      # Wrong Target Specified ####
      ################################
  
      target = "WRONG"
  
      # Case 1: Without exogenous ----
      column = "A"
      with pytest.raises(ValueError) as errmsg:
          exp.setup(data=data[column], target=target)
  
      exceptionmsg = errmsg.value.args[0]
  
      assert (
          exceptionmsg
          == f"Target = '{target}', but data only has '{column}'. "
          "If you are passing a series (or a dataframe with 1 column) "
          "to setup, you can leave `target=None`"
      )
  
      # Case 2: With exogenous ----
      with pytest.raises(ValueError) as errmsg:
          exp.setup(data=data, target=target)
  
      exceptionmsg = errmsg.value.args[0]
      assert (
          exceptionmsg
          == f"Target Column '{target}' is not present in the data."
      )
  
file_path: pycaret/tests/test_time_series_exogenous.py
imports: import numpy
  import pandas
  import pytest
  from pycaret.time_series import TSForecastingExperiment
  from pycaret.utils.time_series import TSApproachTypes, TSExogenousPresent
label_desc: Use image node_id 4 for calling a global function with example usage: test_setup_raises() without return types