code: def test_search_conftest_up_to_inifile(
      pytester: Pytester, confcutdir: str, passed: int, error: int
  ) -> None:
      """Test that conftest files are detected only up to an ini file, unless
      an explicit --confcutdir option is given.
      """
      root = pytester.path
      src = root.joinpath("src")
      src.mkdir()
      src.joinpath("pytest.ini").write_text(
          "[pytest]", encoding="utf-8"
      )
      src.joinpath("conftest.py").write_text(
          textwrap.dedent(
              """\
              import pytest
              @pytest.fixture
              def fix1(): pass
              """
          ),
          encoding="utf-8",
      )
      src.joinpath("test_foo.py").write_text(
          textwrap.dedent(
              """\
              def test_1(fix1):
                  pass
              def test_2(out_of_reach):
                  pass
              """
          ),
          encoding="utf-8",
      )
      root.joinpath("conftest.py").write_text(
          textwrap.dedent(
              """\
              import pytest
              @pytest.fixture
              def out_of_reach(): pass
              """
          ),
          encoding="utf-8",
      )
  
      args = [str(src)]
      if confcutdir:
          args = ["--confcutdir=%s" % root.joinpath(confcutdir)]
      result = pytester.runpytest(*args)
      match = ""
      if passed:
          match += "*%d passed*" % passed
      if error:
          match += "*%d error*" % error
      result.stdout.fnmatch_lines(match)
  
imports: import os
  import textwrap
  from pathlib import Path
  from typing import cast
  from typing import Dict
  from typing import Generator
  from typing import List
  from typing import Optional
  from typing import Sequence
  from typing import Union
  import pytest
  from _pytest.config import ExitCode
  from _pytest.config import PytestPluginManager
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pathlib import symlink_or_skip
  from _pytest.pytester import Pytester
  from _pytest.tmpdir import TempPathFactory
label_desc: Use image node_id 21 for calling a global function with example usage: test_search_conftest_up_to_inifile(pytester, confcutdir, passed, error) without return types