MCPcopy
hub / github.com/pytest-dev/pytest / consider_pluginarg

Method consider_pluginarg

src/_pytest/config/__init__.py:837–864  ·  view source on GitHub ↗

:meta private:

(self, arg: str)

Source from the content-addressed store, hash-verified

835 self.consider_pluginarg(parg)
836
837 def consider_pluginarg(self, arg: str) -> None:
838 """:meta private:"""
839 if arg.startswith("no:"):
840 name = arg[3:]
841 if name in essential_plugins:
842 raise UsageError(f"plugin {name} cannot be disabled")
843
844 if name.endswith("conftest.py"):
845 raise UsageError(
846 f"Blocking conftest files using -p is not supported: -p no:{name}\n"
847 "conftest.py files are not plugins and cannot be disabled via -p.\n"
848 )
849
850 # PR #4304: remove stepwise if cacheprovider is blocked.
851 if name == "cacheprovider":
852 self.set_blocked("stepwise")
853 self.set_blocked("pytest_stepwise")
854
855 self.set_blocked(name)
856 if not name.startswith("pytest_"):
857 self.set_blocked("pytest_" + name)
858 else:
859 name = arg
860 # Unblock the plugin.
861 self.unblock(name)
862 if not name.startswith("pytest_"):
863 self.unblock("pytest_" + name)
864 self.import_plugin(arg, consider_entry_points=True)
865
866 def consider_conftest(
867 self, conftestmodule: types.ModuleType, registration_name: str

Callers 3

consider_preparseMethod · 0.95
_prepareconfigFunction · 0.80
fromdictargsMethod · 0.80

Calls 3

import_pluginMethod · 0.95
UsageErrorClass · 0.85
endswithMethod · 0.80

Tested by

no test coverage detected