code: def test_git_config_warning(path=None):
      if "GIT_AUTHOR_NAME" in os.environ:
          raise SkipTest("Found existing explicit identity config")
  
      # Note: An easier way to test this, would be to just set GIT_CONFIG_GLOBAL
      # to point somewhere else. However, this is not supported by git before
      # 2.32. Hence, stick with changed HOME in this test, but be sure to unset a
      # possible GIT_CONFIG_GLOBAL in addition.
  
      patched_env = os.environ.copy()
      patched_env.pop("GIT_CONFIG_GLOBAL", None)
      patched_env.update(get_home_envvars(path))
      with chpwd(path), patch.dict(
          "os.environ", patched_env, clear=True
      ), swallow_logs(new_level=30) as cml:
          out = WitlessRunner().run(
              [sys.executable, "-c", "import datalad"],
              protocol=StdOutErrCapture,
          )
          assert_in("configure Git before", out["stderr"])
  
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 4 for calling a global function with example usage: test_git_config_warning(path) without return types