code: def test_get_metric_ValueError_when_metric_not_in_metrics_allowed():
      """
      Test ValueError is raised when metric is not in metrics allowed.
      """
      metric = "not_a_metric"
  
      err_msg = re.escape(
          (
              f"Allowed metrics are: 'mean_squared_error', 'mean_absolute_error', "
              f"'mean_absolute_percentage_error' and 'mean_squared_log_error'. Got {metric}."
          )
      )
      with pytest.raises(ValueError, match=err_msg):
          _get_metric(metric)
  
file_path: skforecast/skforecast/model_selection/tests/test_get_metric.py
imports: import re
  import pytest
  from pytest import approx
  import numpy
  import pandas
  from skforecast.model_selection.model_selection import _get_metric
  from sklearn.metrics import mean_squared_error
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_absolute_percentage_error
  from sklearn.metrics import mean_squared_log_error
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_metric_ValueError_when_metric_not_in_metrics_allowed() without return types