code: def test_upgrade_checkpoint_file_missing(tmp_path, caplog):
      # path to single file (missing)
      file = tmp_path / "checkpoint.ckpt"
      with mock.patch(
          "sys.argv", ["upgrade_checkpoint.py", str(file)]
      ), caplog.at_level(logging.ERROR):
          with pytest.raises(SystemExit):
              upgrade_main()
          assert f"The path {file} does not exist" in caplog.text
  
      caplog.clear()
  
      # path to non-empty directory, but no checkpoints with matching extension
      file.touch()
      with mock.patch(
          "sys.argv",
          [
              "upgrade_checkpoint.py",
              str(tmp_path),
              "--extension",
              ".other",
          ],
      ), caplog.at_level(logging.ERROR):
          with pytest.raises(SystemExit):
              upgrade_main()
          assert (
              "No checkpoint files with extension .other were found"
              in caplog.text
          )
  
file_path: pytorch-lightning/tests/tests_pytorch/utilities/test_upgrade_checkpoint.py
imports: import logging
  from pathlib import Path
  from unittest import mock
  from unittest.mock import ANY
  import pytest
  import torch
  from lightning.pytorch.utilities.upgrade_checkpoint import main
label_desc: Use image node_id 1 for calling a global function with example usage: test_upgrade_checkpoint_file_missing(tmp_path, caplog) without return types