def test_skip_on_fast_dev_run_tuner(tmp_path):
    """Test that tuner algorithms are skipped if fast dev run is enabled."""
    model = BoringModel()
    model.lr = 0.1  # avoid no-lr-found exception
    model.batch_size = 8
    trainer = Trainer(
        default_root_dir=tmp_path,
        max_epochs=2,
        fast_dev_run=True,
    )
    tuner = Tuner(trainer)

    with pytest.warns(UserWarning, match="Skipping learning rate finder since `fast_dev_run` is enabled."):
        tuner.lr_find(model)

    with pytest.warns(UserWarning, match="Skipping batch size scaler since `fast_dev_run` is enabled."):
        tuner.scale_batch_size(model)
Test that tuner algorithms are skipped if fast dev run is enabled.
tests/tests_pytorch/trainer/flags/test_fast_dev_run.py