Merge pull request #5005 from blueyed/essential_plugins

Split out list of essential plugins
This commit is contained in:
Daniel Hahler
2019-04-03 02:45:19 +02:00
committed by GitHub
4 changed files with 24 additions and 19 deletions

View File

@@ -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")

View File

@@ -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 = "."