def test_mixing_of_dataloader_options(tmp_path, ckpt_path):
    """Verify that dataloaders can be passed to fit."""
    model = BoringModel()
    eval_dataloader = DataLoader(RandomDataset(32, 64))
    trainer_options = {
        "default_root_dir": tmp_path,
        "max_epochs": 1,
        "limit_val_batches": 0.1,
        "limit_train_batches": 0.2,
    }

    # fit model
    trainer = Trainer(**trainer_options)
    trainer.fit(model, val_dataloaders=eval_dataloader)
    assert trainer.val_dataloaders == eval_dataloader

    ckpt_path = trainer.checkpoint_callback.best_model_path if ckpt_path == "specific" else ckpt_path
    trainer.test(dataloaders=eval_dataloader, ckpt_path=ckpt_path)
    assert trainer.test_dataloaders == eval_dataloader
Verify that dataloaders can be passed to fit.
tests/tests_pytorch/trainer/test_dataloaders.py