code: def test_try_loading_lockfile_that_is_gitignored(
      tmp_dir, dvc, scm, dvcignored, file_exists
  ):
      # it should raise error if the file is git-ignored, even if:
      #   1. The file does not exist at all.
      #   2. Or, is dvc-ignored.
      files = [".gitignore"]
      if dvcignored:
          files.append(".dvcignore")
  
      for file in files:
          with (tmp_dir / file).open(mode="a+") as fd:
              fd.write("dvc.lock")
  
      if file_exists:
          (tmp_dir / "dvc.lock").write_text("")
  
      scm._reset()
  
      with pytest.raises(FileIsGitIgnored) as exc_info:
          Lockfile(dvc, "dvc.lock").load()
  
      assert str(exc_info.value) == "'dvc.lock' is git-ignored."
  
file_path: dvc/tests/unit/test_lockfile.py
imports: import pytest
  from dvc.dvcfile import FileIsGitIgnored, Lockfile
  from dvc.stage import PipelineStage
  from dvc.utils.strictyaml import YAMLValidationError
label_desc: Use image node_id 7 for calling a global function with example usage: test_try_loading_lockfile_that_is_gitignored(tmp_dir, dvc, scm, dvcignored, file_exists) without return types