code: def test_running_test_pretrained_model_cpu(tmpdir):
      """Verify test() on pretrained model."""
      seed_everything(1)
  
      dm = ClassifDataModule()
      model = ClassificationModel()
  
      # logger file to get meta
      logger = tutils.get_default_logger(tmpdir)
  
      # logger file to get weights
      checkpoint = tutils.init_checkpoint_callback(logger)
  
      trainer_options = {
          "enable_progress_bar": False,
          "max_epochs": 2,
          "limit_train_batches": 2,
          "limit_val_batches": 2,
          "limit_test_batches": 2,
          "callbacks": [checkpoint],
          "logger": logger,
          "default_root_dir": tmpdir,
      }
  
      # fit model
      trainer = Trainer(**trainer_options)
      trainer.fit(model, datamodule=dm)
  
      # correct result and ok accuracy
      assert (
          trainer.state.finished
      ), f"Training failed with {trainer.state}"
      pretrained_model = ClassificationModel.load_from_checkpoint(
          trainer.checkpoint_callback.best_model_path
      )
  
      new_trainer = Trainer(**trainer_options)
      new_trainer.test(pretrained_model, datamodule=dm)
  
      # test we have good test accuracy
      tutils.assert_ok_model_acc(new_trainer, key="test_acc", thr=0.45)
  
imports: import glob
  import logging
  import os
  import pickle
  from copy import deepcopy
  from typing import Generic, Mapping, TypeVar
  import cloudpickle
  import pytest
  import torch
  from lightning.fabric import seed_everything
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.states import TrainerFn
  from lightning_utilities.test.warning import no_warning_call
  from torch import Tensor
  import tests_pytorch.helpers.pipelines
  import tests_pytorch.helpers.utils
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
  from tests_pytorch.loops.test_loops import CustomException
label_desc: Use image node_id 9 for calling a global function with example usage: test_running_test_pretrained_model_cpu(tmpdir) without return types