Merge pull request #7351 from cool-RR/2020-06-11-raise-from

Fix exception causes in config/__init__.py
This commit is contained in:
Ran Benita 2020-06-14 18:03:56 +03:00 committed by GitHub
commit 4f4c2638d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -653,7 +653,7 @@ class PytestPluginManager(PluginManager):
except ImportError as e:
raise ImportError(
'Error importing plugin "{}": {}'.format(modname, str(e.args[0]))
).with_traceback(e.__traceback__)
).with_traceback(e.__traceback__) from e
except Skipped as e:
from _pytest.warnings import _issue_warning_captured
@ -1247,12 +1247,12 @@ class Config:
for ini_config in self._override_ini:
try:
key, user_ini_value = ini_config.split("=", 1)
except ValueError:
except ValueError as e:
raise UsageError(
"-o/--override-ini expects option=value style (got: {!r}).".format(
ini_config
)
)
) from e
else:
if key == name:
value = user_ini_value