def test_deepspeed_gradient_clip_by_value(tmp_path):
    """Test to ensure that an exception is raised when using `gradient_clip_algorithm='value'`."""
    model = BoringModel()
    trainer = Trainer(
        default_root_dir=tmp_path,
        accelerator="gpu",
        devices=1,
        strategy="deepspeed",
        gradient_clip_algorithm="value",
        enable_progress_bar=False,
        enable_model_summary=False,
    )
    with pytest.raises(MisconfigurationException, match="does not support clipping gradients by value"):
        trainer.fit(model)
Test to ensure that an exception is raised when using `gradient_clip_algorithm='value'`.
tests/tests_pytorch/strategies/test_deepspeed.py