def test_conftest_symlink(pytester: Pytester) -> None:
    """`conftest.py` discovery follows normal path resolution and does not resolve symlinks."""
    # Structure:
    # /real
    # /real/conftest.py
    # /real/app
    # /real/app/tests
    # /real/app/tests/test_foo.py

    # Links:
    # /symlinktests -> /real/app/tests (running at symlinktests should fail)
    # /symlink -> /real (running at /symlink should work)

    real = pytester.mkdir("real")
    realtests = real.joinpath("app/tests")
    realtests.mkdir(parents=True)
    symlink_or_skip(realtests, pytester.path.joinpath("symlinktests"))
    symlink_or_skip(real, pytester.path.joinpath("symlink"))
    pytester.makepyfile(
        **{
            "real/app/tests/test_foo.py": "def test1(fixture): pass",
            "real/conftest.py": textwrap.dedent(
                """
                import pytest

                print("conftest_loaded")

                @pytest.fixture
                def fixture():
                    print("fixture_used")
                """
            ),
        }
    )

    # Should fail because conftest cannot be found from the link structure.
    result = pytester.runpytest("-vs", "symlinktests")
    result.stdout.fnmatch_lines(["*fixture 'fixture' not found*"])
    assert result.ret == ExitCode.TESTS_FAILED

    # Should not cause "ValueError: Plugin already registered" (#4174).
    result = pytester.runpytest("-vs", "symlink")
    assert result.ret == ExitCode.OK
`conftest.py` discovery follows normal path resolution and does not resolve symlinks.
testing/test_conftest.py