code: def test_fit_loop_done_log_messages(caplog):
      trainer = Mock(spec=Trainer)
      fit_loop = _FitLoop(trainer, max_epochs=1)
  
      trainer.should_stop = False
      fit_loop.max_batches = 5
      assert not fit_loop.done
      assert not caplog.messages
  
      fit_loop.max_batches = 0
      assert fit_loop.done
      assert "No training batches" in caplog.text
      caplog.clear()
      fit_loop.max_batches = 5
  
      epoch_loop = Mock()
      epoch_loop.global_step = 10
      fit_loop.epoch_loop = epoch_loop
      epoch_loop.max_steps = 10
      assert fit_loop.done
      assert "max_steps=10` reached" in caplog.text
      caplog.clear()
      epoch_loop.max_steps = 20
  
      fit_loop.epoch_progress.current.processed = 3
      fit_loop.max_epochs = 3
      trainer.should_stop = True
      assert fit_loop.done
      assert "max_epochs=3` reached" in caplog.text
      caplog.clear()
      fit_loop.max_epochs = 5
  
      fit_loop.epoch_loop.min_steps = 0
      with caplog.at_level(
          level=logging.DEBUG,
          logger="lightning.pytorch.utilities.rank_zero",
      ):
          assert fit_loop.done
      assert "should_stop` was set" in caplog.text
  
      fit_loop.epoch_loop.min_steps = 100
      assert not fit_loop.done
  
file_path: pytorch-lightning/tests/tests_pytorch/loops/test_training_loop.py
imports: import logging
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.pytorch import Trainer, seed_everything
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loops import _FitLoop
label_desc: Use image node_id 5 for calling a global function with example usage: test_fit_loop_done_log_messages(caplog) without return types