code: def test_no_models_raise(fit_helper, dataset_loader_helper):
      """Tests that logic works properly when no models are trained, and tests predictor.model_failures()"""
  
      expected_exc_str = "Test Error Message"
  
      # Force DummyModel to raise an exception when fit.
      fit_args = dict(
          hyperparameters={
              DummyModel: {
                  "raise": ValueError,
                  "raise_msg": expected_exc_str,
              }
          },
      )
  
      dataset_name = "adult"
      directory_prefix = "./datasets/"
      (
          train_data,
          test_data,
          dataset_info,
      ) = dataset_loader_helper.load_dataset(
          name=dataset_name, directory_prefix=directory_prefix
      )
  
      predictor = fit_helper.fit_dataset(
          train_data=train_data,
          init_args=dict(label=dataset_info["label"]),
          fit_args=fit_args,
      )
  
      assert not predictor.model_names()
      with pytest.raises(AssertionError):
          predictor.predict(test_data)
      assert len(predictor.leaderboard()) == 0
      assert len(predictor.leaderboard(test_data)) == 0
  
      model_failures = predictor.model_failures()
      assert len(model_failures) == 1
      model_failures_dict = model_failures.iloc[0].to_dict()
      assert model_failures_dict["model"] == "DummyModel"
      assert model_failures_dict["model_type"] == "DummyModel"
      assert model_failures_dict["exc_type"] == "ValueError"
      assert model_failures_dict["exc_str"] == expected_exc_str
  
file_path: autogluon/tabular/tests/unittests/models/test_dummy.py
imports: import os
  from pathlib import Path
  import pytest
  from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION
  from autogluon.core.metrics import METRICS
  from autogluon.core.models.dummy.dummy_model import DummyModel
label_desc: Use image node_id 2 for calling a global function with example usage: test_no_models_raise(fit_helper, dataset_loader_helper) without return types