code: def test_predict_model_metrics_displayed(load_pos_and_neg_data):
      """Tests different cases in predict_model when metrics should and should not
      be displayed"""
      exp = TSForecastingExperiment()
      FH = 12
      exp.setup(
          data=load_pos_and_neg_data,
          fold=2,
          fh=FH,
          fold_strategy="sliding",
          verbose=False,
      )
  
      model = exp.create_model("naive")
  
      ######################################
      # Test before finalizing model ####
      ######################################
      # Default (Correct comparison to test set)
      _ = exp.predict_model(model)
      expected = exp.pull()
  
      # Metrics are returned ----
      # (1) User provides fh resulting in prediction whose indices are same as y_test
      _ = exp.predict_model(model, fh=FH)
      metrics = exp.pull()
      assert metrics.equals(expected)
  
      # No metrics returned ----
      # All values are 0
      expected.iloc[0, 1:] = 0
      cols = expected.select_dtypes(include=["float"])
      for col in cols:
          expected[col] = expected[col].astype(np.int64)
  
      # (2) User provides fh resulting in prediction whose indices are less than y_test
      _ = exp.predict_model(model, fh=FH - 1)
      metrics = exp.pull()
      assert metrics.equals(expected)
  
      # (3) User provides fh resulting in prediction whose indices are more than y_test
      _ = exp.predict_model(model, fh=FH + 1)
      metrics = exp.pull()
      assert metrics.equals(expected)
  
file_path: pycaret/tests/test_time_series_base.py
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from sktime.forecasting.compose import ForecastingPipeline
  from time_series_test_utils import _return_compare_model_args, _return_model_parameters
  from pycaret.time_series import TSForecastingExperiment
label_desc: Use image node_id 2 for calling a global function with example usage: test_predict_model_metrics_displayed(load_pos_and_neg_data) without return types