code: def test_evaluate(tmpdir, trainer_kwargs):
      dm = ClassifDataModule()
      model = ClassificationModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=2,
          limit_train_batches=10,
          limit_val_batches=10,
          **trainer_kwargs,
      )
  
      trainer.fit(model, datamodule=dm)
      assert "ckpt" in trainer.checkpoint_callback.best_model_path
  
      old_weights = model.layer_0.weight.clone().detach().cpu()
  
      trainer.validate(datamodule=dm)
      trainer.test(datamodule=dm)
  
      # make sure weights didn't change
      new_weights = model.layer_0.weight.clone().detach().cpu()
      torch.testing.assert_close(old_weights, new_weights)
  
file_path: pytorch-lightning/tests/tests_pytorch/strategies/test_common.py
imports: from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0
  from lightning.pytorch import Trainer
  from lightning.pytorch.plugins import DoublePrecision, HalfPrecision, Precision
  from lightning.pytorch.strategies import SingleDeviceStrategy
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 1 for calling a global function with example usage: test_evaluate(tmpdir, trainer_kwargs) without return types