def test_mlflow_logger_with_unexpected_characters(mlflow_mock, tmp_path):
    """Test that the logger raises warning with special characters not accepted by MLFlow."""
    logger = MLFlowLogger("test", save_dir=str(tmp_path))
    metrics = {"[some_metric]": 10}

    with pytest.warns(RuntimeWarning, match="special characters in metric name"):
        logger.log_metrics(metrics)
Test that the logger raises warning with special characters not accepted by MLFlow.
tests/tests_pytorch/loggers/test_mlflow.py