code: def test_try_loading_dvcfile_that_is_gitignored(
      tmp_dir, dvc, scm, file
  ):
      with open(tmp_dir / ".gitignore", "a+", encoding="utf-8") as fd:
          fd.write(file)
  
      # create a file just to avoid other checks
      (tmp_dir / file).write_text("")
      scm._reset()
  
      dvcfile = load_file(dvc, file)
      with pytest.raises(FileIsGitIgnored) as exc_info:
          dvcfile._load()
  
      assert (
          str(exc_info.value)
          == f"bad DVC file name '{file}' is git-ignored."
      )
  
file_path: dvc/tests/unit/test_dvcfile.py
imports: import pytest
  from dvc.dvcfile import LOCK_FILE, PROJECT_FILE, FileIsGitIgnored, ProjectFile, SingleStageFile, load_file
  from dvc.stage import PipelineStage
  from dvc.stage.exceptions import StageFileDoesNotExistError, StageFileIsNotDvcFileError
  from dvc.utils.fs import remove
  from dvc.utils.serialize import EncodingError
  from dvc.utils.strictyaml import YAMLValidationError
label_desc: Use image node_id 8 for calling a global function with example usage: test_try_loading_dvcfile_that_is_gitignored(tmp_dir, dvc, scm, file) without return types