Merge pull request #5005 from blueyed/essential_plugins
Split out list of essential plugins
This commit is contained in:
@@ -112,13 +112,18 @@ def directory_arg(path, optname):
|
||||
return path
|
||||
|
||||
|
||||
default_plugins = (
|
||||
# Plugins that cannot be disabled via "-p no:X" currently.
|
||||
essential_plugins = (
|
||||
"mark",
|
||||
"main",
|
||||
"terminal",
|
||||
"runner",
|
||||
"python",
|
||||
"fixtures",
|
||||
"helpconfig", # Provides -p.
|
||||
)
|
||||
|
||||
default_plugins = essential_plugins + (
|
||||
"terminal", # Has essential options, but xdist uses -pno:terminal.
|
||||
"debugging",
|
||||
"unittest",
|
||||
"capture",
|
||||
@@ -127,7 +132,6 @@ default_plugins = (
|
||||
"monkeypatch",
|
||||
"recwarn",
|
||||
"pastebin",
|
||||
"helpconfig",
|
||||
"nose",
|
||||
"assertion",
|
||||
"junitxml",
|
||||
@@ -143,7 +147,6 @@ default_plugins = (
|
||||
"reports",
|
||||
)
|
||||
|
||||
|
||||
builtin_plugins = set(default_plugins)
|
||||
builtin_plugins.add("pytester")
|
||||
|
||||
@@ -496,6 +499,9 @@ class PytestPluginManager(PluginManager):
|
||||
def consider_pluginarg(self, arg):
|
||||
if arg.startswith("no:"):
|
||||
name = arg[3:]
|
||||
if name in essential_plugins:
|
||||
raise UsageError("plugin %s cannot be disabled" % name)
|
||||
|
||||
# PR #4304 : remove stepwise if cacheprovider is blocked
|
||||
if name == "cacheprovider":
|
||||
self.set_blocked("stepwise")
|
||||
|
||||
@@ -173,6 +173,7 @@ def getreportopt(config):
|
||||
return reportopts
|
||||
|
||||
|
||||
@pytest.hookimpl(trylast=True) # after _pytest.runner
|
||||
def pytest_report_teststatus(report):
|
||||
if report.passed:
|
||||
letter = "."
|
||||
|
||||
Reference in New Issue
Block a user