def test_mlflow_experiment_id_retrieved_once(_, mlflow_mock, tmp_path):
    """Test that the logger experiment_id retrieved only once."""
    logger = MLFlowLogger("test", save_dir=str(tmp_path))
    _ = logger.experiment
    _ = logger.experiment
    _ = logger.experiment
    assert logger.experiment.get_experiment_by_name.call_count == 1
Test that the logger experiment_id retrieved only once.
tests/tests_pytorch/loggers/test_mlflow.py