| 558 | return opts |
| 559 | |
| 560 | def register(self, plugin: _PluggyPlugin, name: str | None = None) -> str | None: |
| 561 | if name in _pytest.deprecated.DEPRECATED_EXTERNAL_PLUGINS: |
| 562 | warnings.warn( |
| 563 | PytestConfigWarning( |
| 564 | class="st">"{} plugin has been merged into the core, " |
| 565 | class="st">"please remove it from your requirements.".format( |
| 566 | name.replace(class="st">"_", class="st">"-") |
| 567 | ) |
| 568 | ) |
| 569 | ) |
| 570 | return None |
| 571 | plugin_name = super().register(plugin, name) |
| 572 | if plugin_name is not None: |
| 573 | self.hook.pytest_plugin_registered.call_historic( |
| 574 | kwargs=dict( |
| 575 | plugin=plugin, |
| 576 | plugin_name=plugin_name, |
| 577 | manager=self, |
| 578 | ) |
| 579 | ) |
| 580 | |
| 581 | if isinstance(plugin, types.ModuleType): |
| 582 | self.consider_module(plugin) |
| 583 | return plugin_name |
| 584 | |
| 585 | def getplugin(self, name: str): |
| 586 | class="cm"># Support deprecated naming because plugins (xdist e.g.) use it. |