Fix exception causes in config/__init__.py
This commit is contained in:
parent
0821c5c81d
commit
caa984c029
|
@ -641,7 +641,7 @@ class PytestPluginManager(PluginManager):
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
'Error importing plugin "{}": {}'.format(modname, str(e.args[0]))
|
'Error importing plugin "{}": {}'.format(modname, str(e.args[0]))
|
||||||
).with_traceback(e.__traceback__)
|
).with_traceback(e.__traceback__) from e
|
||||||
|
|
||||||
except Skipped as e:
|
except Skipped as e:
|
||||||
from _pytest.warnings import _issue_warning_captured
|
from _pytest.warnings import _issue_warning_captured
|
||||||
|
@ -1197,12 +1197,12 @@ class Config:
|
||||||
for ini_config in self._override_ini:
|
for ini_config in self._override_ini:
|
||||||
try:
|
try:
|
||||||
key, user_ini_value = ini_config.split("=", 1)
|
key, user_ini_value = ini_config.split("=", 1)
|
||||||
except ValueError:
|
except ValueError as e:
|
||||||
raise UsageError(
|
raise UsageError(
|
||||||
"-o/--override-ini expects option=value style (got: {!r}).".format(
|
"-o/--override-ini expects option=value style (got: {!r}).".format(
|
||||||
ini_config
|
ini_config
|
||||||
)
|
)
|
||||||
)
|
) from e
|
||||||
else:
|
else:
|
||||||
if key == name:
|
if key == name:
|
||||||
value = user_ini_value
|
value = user_ini_value
|
||||||
|
|
Loading…
Reference in New Issue