def test_issue_9765(pytester: Pytester) -> None:
    """Reproducer for issue #9765 on Windows

    https://github.com/pytest-dev/pytest/issues/9765
    """
    pytester.makepyprojecttoml(
        """
        [tool.pytest.ini_options]
        addopts = "-p my_package.plugin.my_plugin"
        """
    )
    pytester.makepyfile(
        **{
            "setup.py": (
                """
                from setuptools import setup

                if __name__ == '__main__':
                    setup(name='my_package', packages=['my_package', 'my_package.plugin'])
                """
            ),
            "my_package/__init__.py": "",
            "my_package/conftest.py": "",
            "my_package/test_foo.py": "def test(): pass",
            "my_package/plugin/__init__.py": "",
            "my_package/plugin/my_plugin.py": (
                """
                import pytest

                def pytest_configure(config):

                    class SimplePlugin:
                        @pytest.fixture(params=[1, 2, 3])
                        def my_fixture(self, request):
                            yield request.param

                    config.pluginmanager.register(SimplePlugin())
                """
            ),
        }
    )

    subprocess.run(
        [sys.executable, "-Im", "pip", "install", "-e", "."],
        check=True,
    )
    try:
        # We are using subprocess.run rather than pytester.run on purpose.
        # pytester.run is adding the current directory to PYTHONPATH which avoids
        # the bug. We also use pytest rather than python -m pytest for the same
        # PYTHONPATH reason.
        subprocess.run(
            ["pytest", "my_package"],
            capture_output=True,
            check=True,
            encoding="utf-8",
            text=True,
        )
    except subprocess.CalledProcessError as exc:
        raise AssertionError(
            f"pytest command failed:\n{exc.stdout=!s}\n{exc.stderr=!s}"
        ) from exc
Reproducer for issue #9765 on Windows

    https://github.com/pytest-dev/pytest/issues/9765
    
testing/acceptance_test.py