MCPcopy Create free account
hub / github.com/pytest-dev/pytest / consider_pluginarg

Method consider_pluginarg

src/_pytest/config/__init__.py:673–697  ·  view source on GitHub ↗

:meta private:

(self, arg: str)

Source from the content-addressed store, hash-verified

671 self.consider_pluginarg(parg)
672
673 def consider_pluginarg(self, arg: str) -> None:
674 """:meta private:"""
675 if arg.startswith("no:"):
676 name = arg[3:]
677 if name in essential_plugins:
678 raise UsageError("plugin %s cannot be disabled" % name)
679
680 # PR #4304: remove stepwise if cacheprovider is blocked.
681 if name == "cacheprovider":
682 self.set_blocked("stepwise")
683 self.set_blocked("pytest_stepwise")
684
685 self.set_blocked(name)
686 if not name.startswith("pytest_"):
687 self.set_blocked("pytest_" + name)
688 else:
689 name = arg
690 # Unblock the plugin. None indicates that it has been blocked.
691 # There is no interface with pluggy for this.
692 if self._name2plugin.get(name, -1) is None:
693 del self._name2plugin[name]
694 if not name.startswith("pytest_"):
695 if self._name2plugin.get("pytest_" + name, -1) is None:
696 del self._name2plugin["pytest_" + name]
697 self.import_plugin(arg, consider_entry_points=True)
698
699 def consider_conftest(self, conftestmodule: types.ModuleType) -> None:
700 """:meta private:"""

Callers 3

consider_preparseMethod · 0.95
_prepareconfigFunction · 0.80
fromdictargsMethod · 0.80

Calls 3

import_pluginMethod · 0.95
UsageErrorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected