code: def test_should_stop_early_stopping_conditions_met(
      caplog,
      min_epochs,
      min_steps,
      current_epoch,
      early_stop,
      fit_loop_done,
      raise_debug_msg,
  ):
      """Test that checks that debug message is logged when users sets `should_stop` and min conditions are met."""
      trainer = Trainer(
          min_epochs=min_epochs,
          min_steps=min_steps,
          limit_val_batches=0,
          max_epochs=100,
      )
      trainer.fit_loop.max_batches = 10
      trainer.should_stop = True
      trainer.fit_loop.epoch_loop.automatic_optimization.optim_progress.optimizer.step.total.completed = (
          current_epoch * trainer.num_training_batches
      )
      trainer.fit_loop.epoch_loop.batch_progress.current.ready = 10
      trainer.fit_loop.epoch_progress.current.processed = current_epoch
  
      message = "`Trainer.fit` stopped: `trainer.should_stop` was set."
      with caplog.at_level(
          level=logging.DEBUG,
          logger="lightning.pytorch.utilities.rank_zero",
      ):
          assert trainer.fit_loop.done is fit_loop_done
  
      assert (message in caplog.text) is raise_debug_msg
      assert trainer.fit_loop._can_stop_early is early_stop
  
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 6 for calling a global function with example usage: test_should_stop_early_stopping_conditions_met(caplog, min_epochs, min_steps, current_epoch, early_stop, fit_loop_done, raise_debug_msg) without return types