code: def test_valid_metrics(metric, expected_error, expected_error_msg):
      if not expected_error:
          assert callable(val.get_scoring_metric(metric))
      else:
          with pytest.raises(expected_error) as err:
              val.get_scoring_metric(metric)
          assert expected_error_msg in pytest_error_str(err)
  
file_path: pmdarima/pmdarima/arima/tests/test_validation.py
imports: import numpy
  import pytest
  from pmdarima.compat.pytest import pytest_warning_messages, pytest_error_str
  from pmdarima.arima import _validation
  from pmdarima.warnings import ModelFitWarning
label_desc: Use image node_id 7 for calling a global function with example usage: test_valid_metrics(metric, expected_error, expected_error_msg) without return types