feat: add compatibility check between pytest-playwright and pytest-playwright-asyncio
Related to https://github.com/microsoft/playwright-pytest/issues/278 (and specifically https://github.com/microsoft/playwright-pytest/issues/278#issuecomment-2941493248).
@mxschmitt here's a first pass!
@mxschmitt Thanks for the suggestion! I've implemented the compatibility check in pytest_addoption as you recommended.
Key Improvements
✅ Earlier detection - Check now occurs during plugin loading, not fixture execution
✅ Better user experience - Clear error messages instead of confusing "option names already added" errors
✅ Type safety - Added proper type annotations (Parser, PytestPluginManager)
✅ Code quality - All pre-commit hooks pass (black, mypy, flake8)
The implementation detects the incompatible plugin using pluginmanager.hasplugin() and raises a clear RuntimeError before any option registration conflicts can occur. This provides immediate, actionable feedback to users who accidentally install both plugins.
Ready for review! 🚀
Thanks @mxschmitt and @Skn0tt!