code: def test_error_if_train_or_val_dataloaders_passed_with_eval_method():
      """Test that an error is raised if `train_dataloaders` or `val_dataloaders` is passed with eval method inside
      `Tuner`"""
      trainer = Trainer()
      tuner = Tuner(trainer)
      model = BoringModel()
      dl = model.train_dataloader()
  
      with pytest.raises(
          MisconfigurationException,
          match="please consider setting `dataloaders` instead",
      ):
          tuner.scale_batch_size(
              model, train_dataloaders=dl, method="validate"
          )
  
      with pytest.raises(
          MisconfigurationException,
          match="please consider setting `dataloaders` instead",
      ):
          tuner.scale_batch_size(
              model, val_dataloaders=dl, method="validate"
          )
  
imports: import logging
  import os
  from copy import deepcopy
  from unittest.mock import patch
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel, RandomDataset
  from lightning.pytorch.tuner.tuning import Tuner
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning_utilities.test.warning import no_warning_call
  from torch.utils.data import DataLoader
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 16 for calling a global function with example usage: test_error_if_train_or_val_dataloaders_passed_with_eval_method() without return types