def test_installed_conftest_is_picked_up(pytester: Pytester, tmp_path: Path) -> None:
    """When using `--pyargs` to run tests in an installed packages (located e.g.
    in a site-packages in the PYTHONPATH), conftest files in there are picked
    up.

    Regression test for #9767.
    """
    # pytester dir - the source tree.
    # tmp_path - the simulated site-packages dir (not in source tree).

    pytester.syspathinsert(tmp_path)
    pytester.makepyprojecttoml("[tool.pytest.ini_options]")
    tmp_path.joinpath("foo").mkdir()
    tmp_path.joinpath("foo", "__init__.py").touch()
    tmp_path.joinpath("foo", "conftest.py").write_text(
        textwrap.dedent(
            """\
            import pytest
            @pytest.fixture
            def fix(): return None
            """
        ),
        encoding="utf-8",
    )
    tmp_path.joinpath("foo", "test_it.py").write_text(
        "def test_it(fix): pass", encoding="utf-8"
    )
    result = pytester.runpytest("--pyargs", "foo")
    assert result.ret == 0
When using `--pyargs` to run tests in an installed packages (located e.g.
    in a site-packages in the PYTHONPATH), conftest files in there are picked
    up.

    Regression test for #9767.
    
testing/test_conftest.py