code: def test_mlflow_run_name_setting(tmp_path):
      """Test that the run_name argument makes the MLFLOW_RUN_NAME tag."""
      if not _MLFLOW_AVAILABLE:
          pytest.skip(
              "test for explicit file creation requires mlflow dependency to be installed."
          )
  
      from mlflow.utils.mlflow_tags import MLFLOW_RUN_NAME
  
      resolve_tags = _get_resolve_tags()
      tags = resolve_tags({MLFLOW_RUN_NAME: "run-name-1"})
  
      # run_name is appended to tags
      logger = MLFlowLogger(
          "test", run_name="run-name-1", save_dir=str(tmp_path)
      )
      logger._mlflow_client = client = Mock()
  
      logger = mock_mlflow_run_creation(logger, experiment_id="exp-id")
      _ = logger.experiment
      client.create_run.assert_called_with(
          experiment_id="exp-id", tags=tags
      )
  
      # run_name overrides tags[MLFLOW_RUN_NAME]
      logger = MLFlowLogger(
          "test",
          run_name="run-name-1",
          tags={MLFLOW_RUN_NAME: "run-name-2"},
          save_dir=str(tmp_path),
      )
      logger = mock_mlflow_run_creation(logger, experiment_id="exp-id")
      _ = logger.experiment
      client.create_run.assert_called_with(
          experiment_id="exp-id", tags=tags
      )
  
      # default run_name (= None) does not append new tag
      logger = MLFlowLogger("test", save_dir=str(tmp_path))
      logger = mock_mlflow_run_creation(logger, experiment_id="exp-id")
      _ = logger.experiment
      default_tags = resolve_tags(None)
      client.create_run.assert_called_with(
          experiment_id="exp-id", tags=default_tags
      )
  
imports: import os
  from unittest import mock
  from unittest.mock import MagicMock, Mock
  import pytest
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers.mlflow import _MLFLOW_AVAILABLE, MLFlowLogger, _get_resolve_tags
label_desc: Use image node_id 3 for calling a global function with example usage: test_mlflow_run_name_setting(tmp_path) without return types