Skip to content

Commit 8466ff8

Browse files
committed
fix testing
1 parent b9c46bd commit 8466ff8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/tests_pytorch/loggers/test_mlflow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,17 @@ def test_mlflow_logger_no_synchronous_support(mlflow_mock, tmp_path):
317317

318318
@mock.patch("lightning.pytorch.loggers.mlflow._get_resolve_tags", Mock())
319319
def test_mlflow_logger_with_long_param_value(mlflow_mock, tmp_path):
320-
"""Test that long parameter values are truncated to 250 characters."""
320+
"""Test that long parameter values are truncated using MLflow's MAX_PARAM_VAL_LENGTH."""
321+
from mlflow.utils.validation import MAX_PARAM_VAL_LENGTH
321322

322323
def _check_value_length(value, *args, **kwargs):
323-
assert len(value) <= 250
324+
assert len(value) <= MAX_PARAM_VAL_LENGTH
324325

325326
mlflow_mock.entities.Param.side_effect = _check_value_length
326327

327328
logger = MLFlowLogger("test", save_dir=str(tmp_path))
328329

329-
params = {"test": "test_param" * 50}
330+
params = {"test": "test_param" * 1000}
330331
logger.log_hyperparams(params)
331332

332333
# assert_called_once_with() won't properly check the parameter value.

0 commit comments

Comments
 (0)