def test_batch_size_finder_with_multiple_eval_dataloaders(tmp_path):
    """Test that an error is raised with batch size finder is called with multiple eval dataloaders."""

    class CustomModel(BoringModel):
        def val_dataloader(self):
            return [super().val_dataloader(), super().val_dataloader()]

    trainer = Trainer(logger=False, enable_checkpointing=False)
    tuner = Tuner(trainer)
    model = CustomModel()

    with pytest.raises(
        MisconfigurationException, match="Batch size finder cannot be used with multiple .* dataloaders"
    ):
        tuner.scale_batch_size(model, method="validate")
Test that an error is raised with batch size finder is called with multiple eval dataloaders.
tests/tests_pytorch/tuner/test_scale_batch_size.py