code: def test_not_under_git(path=None):
      from datalad.distribution.dataset import require_dataset
  
      dsroot = get_dataset_root(path)
      assert (
          dsroot is None
      ), "There must be no dataset above tmp %s. Got: %s" % (
          path,
          dsroot,
      )
      with chpwd(path):
          # And require_dataset must puke also
          assert_raises(
              Exception,
              require_dataset,
              None,
              check_installed=True,
              purpose="test",
          )
  
file_path: datalad/datalad/tests/test_base.py
imports: import os
  import os.path
  import sys
  from unittest.mock import patch
  from datalad.cmd import WitlessRunner, StdOutErrCapture
  from datalad.tests.utils_pytest import SkipTest, assert_in, assert_raises, chpwd, get_dataset_root, ok_file_has_content, swallow_logs, with_tree
  from datalad.utils import get_home_envvars
label_desc: Use image node_id 2 for calling a global function with example usage: test_not_under_git(path) without return types