code: def test_has_ancestor(self, tmp_path: Path) -> None:
      fn1 = tmp_path / "foo" / "bar" / "test_1.py"
      fn1.parent.mkdir(parents=True)
      fn1.touch()
      fn2 = tmp_path / "foo" / "zaz" / "test_2.py"
      fn2.parent.mkdir(parents=True)
      fn2.touch()
      assert get_common_ancestor([fn1, fn2]) == tmp_path / "foo"
      assert get_common_ancestor([fn1.parent, fn2]) == tmp_path / "foo"
      assert (
          get_common_ancestor([fn1.parent, fn2.parent])
          == tmp_path / "foo"
      )
      assert get_common_ancestor([fn1, fn2.parent]) == tmp_path / "foo"
  
imports: import os
  from pathlib import Path
  from textwrap import dedent
  import pytest
  from _pytest.config import UsageError
  from _pytest.config.findpaths import get_common_ancestor
  from _pytest.config.findpaths import get_dirs_from_args
  from _pytest.config.findpaths import is_fs_root
  from _pytest.config.findpaths import load_config_dict_from_file
label_desc: Use image node_id 1 for calling the TestCommonAncestor obj's underlying member method code with example usage: obj.test_has_ancestor(tmp_path) without return types