code: def test_state_pickle_errors_are_correctly_raised(
      tmp_dir, caplog, mocker
  ):
      path = tmp_dir / "dir" / "test"
      mocker.patch(
          "dvc.cli.parse_args",
          return_value=Namespace(
              func=raiser(DiskError(path, "md5s")),
              quiet=False,
              verbose=True,
          ),
      )
  
      assert main() == 255
      assert (
          "Could not open pickled 'md5s' cache.\n"
          f"Remove the '{path.relative_to(tmp_dir)}' directory "
          "and then retry this command.\n"
          "See <https://error.dvc.org/pickle> for more information."
          in caplog.text
      )
  
file_path: dvc/tests/unit/cli/test_main.py
imports: from argparse import Namespace
  import pytest
  from funcy import raiser
  from dvc.cli import main
  from dvc_data.hashfile.build import IgnoreInCollectedDirError
  from dvc_data.hashfile.cache import DiskError
  from dvc_objects.fs.base import FileSystem, RemoteMissingDepsError
label_desc: Use image node_id 1 for calling a global function with example usage: test_state_pickle_errors_are_correctly_raised(tmp_dir, caplog, mocker) without return types