code: def test_uncertainty_errors(df):
      # Uncertainty method not recognized.
      with LogCapture(LOGGER_NAME) as log_capture:
          model = ConstantBaseForecastEstimator()
          model.time_col_ = TIME_COL
          model.value_col_ = VALUE_COL
  
          # Only coverage is given.
          # The default uncertainty method is used.
          res = model.fit_uncertainty(
              df=df,
              uncertainty_dict=dict(uncertainty_method="some_method"),
          )
          assert (
              (
                  LOGGER_NAME,
                  "WARNING",
                  f"Uncertainty method some_method is not found in `UncertaintyMethodEnum`, "
                  f"uncertainty fitting is skipped. Valid methods are "
                  f"{', '.join(UncertaintyMethodEnum.__dict__['_member_names_'])}.",
              )
          ) in log_capture.actual()
          assert res is None
          assert model.uncertainty_model is None
  
      # Uncertainty model not trained.
      with LogCapture(LOGGER_NAME) as log_capture:
          model = ConstantBaseForecastEstimator()
          model.time_col_ = TIME_COL
          model.value_col_ = VALUE_COL
          model.predict_uncertainty(df=df)
          assert (
              (
                  LOGGER_NAME,
                  "WARNING",
                  f"The uncertainty model is not trained.",
              )
          ) in log_capture.actual()
  
      # Prediction failed.
      with LogCapture(LOGGER_NAME) as log_capture:
          model = ConstantBaseForecastEstimator()
          model.time_col_ = TIME_COL
          model.value_col_ = VALUE_COL
          model.fit_uncertainty(
              df=df,
              uncertainty_dict={
                  "uncertainty_method": "simple_conditional_residuals",
                  "params": {
                      "is_residual_based": True,
                      "predicted_col": PREDICTED_COL,
                  },
              },
          )
          model.predict_uncertainty(df=df[[TIME_COL]])
          assert (
              (
                  LOGGER_NAME,
                  "WARNING",
                  f"The following errors occurred during predicting the uncertainty model, "
                  f"the uncertainty model is skipped."
                  f" The offset column {PREDICTED_COL} is not found in `fut_df`.",
              )
          ) in log_capture.actual()
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from testfixtures import LogCapture
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import r2_null_model_score
  from greykite.sklearn.estimator.base_forecast_estimator import BaseForecastEstimator
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 13 for calling a global function with example usage: test_uncertainty_errors(df) without return types