code: def test_resume_incomplete_callbacks_list_warning(tmpdir):
      model = BoringModel()
      callback0 = ModelCheckpoint(monitor="epoch")
      callback1 = ModelCheckpoint(monitor="global_step")
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_steps=1,
          callbacks=[callback0, callback1],
      )
      trainer.fit(model)
      ckpt_path = trainer.checkpoint_callback.best_model_path
  
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_steps=1,
          callbacks=[callback1],  # one callback is missing!
      )
      with pytest.warns(
          UserWarning,
          match=escape(
              f"Please add the following callbacks: [{repr(callback0.state_key)}]"
          ),
      ):
          trainer.fit(model, ckpt_path=ckpt_path)
  
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_steps=1,
          callbacks=[
              callback1,
              callback0,
          ],  # all callbacks here, order switched
      )
      with no_warning_call(
          UserWarning, match="Please add the following callbacks:"
      ):
          trainer.fit(model, ckpt_path=ckpt_path)
  
file_path: pytorch-lightning/tests/tests_pytorch/callbacks/test_callbacks.py
imports: from pathlib import Path
  from re import escape
  from unittest.mock import Mock
  import pytest
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning_utilities.test.warning import no_warning_call
label_desc: Use image node_id 4 for calling a global function with example usage: test_resume_incomplete_callbacks_list_warning(tmpdir) without return types