code: def test_run_context_provider_registry_register_entrypoints_handles_exception(
      exception,
  ):
      mock_entrypoint = mock.Mock()
      mock_entrypoint.load.side_effect = exception
  
      with mock.patch(
          "entrypoints.get_group_all", return_value=[mock_entrypoint]
      ) as mock_get_group_all:
          registry = RunContextProviderRegistry()
          # Check that the raised warning contains the message from the original exception
          with pytest.warns(UserWarning, match="test exception"):
              registry.register_entrypoints()
  
      mock_entrypoint.load.assert_called_once_with()
      mock_get_group_all.assert_called_once_with(
          "mlflow.run_context_provider"
      )
  
file_path: mlflow/tests/tracking/context/test_registry.py
imports: from importlib import reload
  from unittest import mock
  import pytest
  import mlflow.tracking.context.registry
  from mlflow.tracking.context.databricks_job_context import DatabricksJobRunContext
  from mlflow.tracking.context.databricks_notebook_context import DatabricksNotebookRunContext
  from mlflow.tracking.context.databricks_repo_context import DatabricksRepoRunContext
  from mlflow.tracking.context.default_context import DefaultRunContext
  from mlflow.tracking.context.git_context import GitRunContext
  from mlflow.tracking.context.registry import RunContextProviderRegistry, resolve_tags
label_desc: Use image node_id 3 for calling a global function with example usage: test_run_context_provider_registry_register_entrypoints_handles_exception(exception) without return types