code: def test_metric_threshold_class_should_fail(
      metric_threshold_class_test_spec,
  ):
      (
          class_params,
          expected_failure_message,
      ) = metric_threshold_class_test_spec
      with pytest.raises(
          MetricThresholdClassException,
          match=expected_failure_message,
      ):
          MetricThreshold(
              threshold=class_params["threshold"],
              min_absolute_change=class_params["min_absolute_change"],
              min_relative_change=class_params["min_relative_change"],
              greater_is_better=class_params["greater_is_better"],
          )
  
imports: from unittest import mock
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.models.evaluation import EvaluationResult, MetricThreshold, ModelEvaluator, evaluate
  from mlflow.models.evaluation.evaluator_registry import _model_evaluation_registry
  from mlflow.models.evaluation.validation import MetricThresholdClassException, ModelValidationFailedException, _MetricValidationResult
  from tests.evaluate.test_evaluation import iris_dataset, multiclass_logistic_regressor_model_uri
label_desc: Use image node_id 2 for calling a global function with example usage: test_metric_threshold_class_should_fail(metric_threshold_class_test_spec) without return types