| 445 | return opts |
| 446 | |
| 447 | def register( |
| 448 | self, plugin: _PluggyPlugin, name: Optional[str] = None |
| 449 | ) -> Optional[str]: |
| 450 | if name in _pytest.deprecated.DEPRECATED_EXTERNAL_PLUGINS: |
| 451 | warnings.warn( |
| 452 | PytestConfigWarning( |
| 453 | "{} plugin has been merged into the core, " |
| 454 | "please remove it from your requirements.".format( |
| 455 | name.replace("_", "-") |
| 456 | ) |
| 457 | ) |
| 458 | ) |
| 459 | return None |
| 460 | ret: Optional[str] = super().register(plugin, name) |
| 461 | if ret: |
| 462 | self.hook.pytest_plugin_registered.call_historic( |
| 463 | kwargs=dict(plugin=plugin, manager=self) |
| 464 | ) |
| 465 | |
| 466 | if isinstance(plugin, types.ModuleType): |
| 467 | self.consider_module(plugin) |
| 468 | return ret |
| 469 | |
| 470 | def getplugin(self, name: str): |
| 471 | # Support deprecated naming because plugins (xdist e.g.) use it. |