def test_tuner_with_distributed_strategies():
    """Test that an error is raised when tuner is used with multi-device strategy."""
    trainer = Trainer(devices=2, strategy="ddp", accelerator="cpu")
    tuner = Tuner(trainer)
    model = BoringModel()

    with pytest.raises(ValueError, match=r"not supported with distributed strategies"):
        tuner.scale_batch_size(model)
Test that an error is raised when tuner is used with multi-device strategy.
tests/tests_pytorch/tuner/test_tuning.py