code: def test_no_val_on_train_epoch_loop_restart(tmpdir):
      """Test that training validation loop doesn't get triggered at the beginning of a restart."""
      trainer_kwargs = {
          "max_epochs": 1,
          "limit_train_batches": 1,
          "limit_val_batches": 1,
          "num_sanity_val_steps": 0,
          "enable_checkpointing": False,
      }
      trainer = Trainer(**trainer_kwargs)
      model = BoringModel()
      trainer.fit(model)
      ckpt_path = str(tmpdir / "last.ckpt")
      trainer.save_checkpoint(ckpt_path)
  
      trainer_kwargs["max_epochs"] = 2
      trainer = Trainer(**trainer_kwargs)
  
      with patch.object(
          trainer.fit_loop.epoch_loop.val_loop,
          "_evaluation_step",
          wraps=trainer.fit_loop.epoch_loop.val_loop._evaluation_step,
      ) as step_mock:
          trainer.fit(model, ckpt_path=ckpt_path)
      assert step_mock.call_count == 1
  
file_path: pytorch-lightning/tests/tests_pytorch/loops/test_training_epoch_loop.py
imports: import logging
  from unittest.mock import Mock, patch
  import pytest
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.trainer import Trainer
label_desc: Use image node_id 1 for calling a global function with example usage: test_no_val_on_train_epoch_loop_restart(tmpdir) without return types