code: def test_noannex_fail_if_has_annexed(path=None):
      ds = Dataset(path).create(force=True)
      ds.save()
      assert_true(isinstance(ds.repo, AnnexRepo))
      # internally procedure raises RuntimeError, but since we run it via runner, we
      # get CommandError here
      with assert_raises(CommandError):
          ds.run_procedure("cfg_noannex")
  
file_path: datalad/datalad/resources/procedures/tests/test_noannex.py
imports: import pytest
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError
  from datalad.support.gitrepo import GitRepo
  from datalad.tests.utils_pytest import assert_false, assert_raises, assert_true, with_tempfile, with_tree
label_desc: Use image node_id 4 for calling a global function with example usage: test_noannex_fail_if_has_annexed(path) without return types