Merge pull request #7765 from nicoddemus/backport-7723

[6.0] Improve output for missing required plugins #7723
This commit is contained in:
Bruno Oliveira 2020-09-17 10:08:38 -03:00 committed by GitHub
commit 819fef87a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1 @@
When a plugin listed in ``required_plugins`` is missing, a simple error message is now shown instead of a stacktrace.

View File

@ -1174,9 +1174,8 @@ class Config:
missing_plugins.append(required_plugin)
if missing_plugins:
fail(
raise UsageError(
"Missing required plugins: {}".format(", ".join(missing_plugins)),
pytrace=False,
)
def _warn_or_fail_if_strict(self, message: str) -> None:

View File

@ -362,7 +362,7 @@ class TestParseIni:
testdir.makeini(ini_file_text)
if exception_text:
with pytest.raises(pytest.fail.Exception, match=exception_text):
with pytest.raises(pytest.UsageError, match=exception_text):
testdir.parseconfig()
else:
testdir.parseconfig()