code: def test_artifacts_add_fails_on_dvc_subrepo(tmp_dir, dvc):
      # adding artifact to the DVC subrepo from the parent DVC repo
      # shouldn't work
      subdir = tmp_dir / "subdir"
      (subdir / ".dvc").mkdir(parents=True)
  
      with pytest.raises(InvalidArgumentError):
          tmp_dir.dvc.artifacts.add(
              "failing",
              Artifact(path="path"),
              dvcfile="subdir/dvc.yaml",
          )
  
      with pytest.raises(InvalidArgumentError):
          tmp_dir.dvc.artifacts.add(
              "failing",
              Artifact(path="path"),
              dvcfile="subdir/dvclive/dvc.yaml",
          )
  
file_path: dvc/tests/func/artifacts/test_artifacts.py
imports: import logging
  import os
  from copy import deepcopy
  import pytest
  from dvc.annotations import Artifact
  from dvc.exceptions import ArtifactNotFoundError, InvalidArgumentError
  from dvc.repo.artifacts import check_name_format
  from dvc.utils.strictyaml import YAMLSyntaxError, YAMLValidationError
label_desc: Use image node_id 5 for calling a global function with example usage: test_artifacts_add_fails_on_dvc_subrepo(tmp_dir, dvc) without return types