code: def test_stage_load_on_invalid_data(tmp_dir, dvc, file):
      data = {"is_this_a_valid_dvcfile": False}
      (tmp_dir / file).dump(data)
      dvcfile = load_file(dvc, file)
      with pytest.raises(YAMLValidationError):
          assert dvcfile.stages
      with pytest.raises(YAMLValidationError):
          assert dvcfile.validate(data, file)
  
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 5 for calling a global function with example usage: test_stage_load_on_invalid_data(tmp_dir, dvc, file) without return types