summaryrefslogtreecommitdiff
path: root/src/_pytest/debugging.py
diff options
context:
space:
mode:
authorRam Rachum <ram@rachum.com>2020-06-19 12:53:44 +0300
committerRam Rachum <ram@rachum.com>2020-06-19 22:02:24 +0300
commitdd446bee5eb2d3ab0976309803dc77821eeac93e (patch)
tree0a55083f63eccafc4bc5c4e80fce89c043968b86 /src/_pytest/debugging.py
parent4cc4ebf3c9f79eb9d7484c763b11dea3ddff4b82 (diff)
downloadpytest-dd446bee5eb2d3ab0976309803dc77821eeac93e.tar.gz
Fix exception causes all over the codebase
Diffstat (limited to 'src/_pytest/debugging.py')
-rw-r--r--src/_pytest/debugging.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py
index 0567927c0..63126cbe0 100644
--- a/src/_pytest/debugging.py
+++ b/src/_pytest/debugging.py
@@ -28,10 +28,10 @@ def _validate_usepdb_cls(value: str) -> Tuple[str, str]:
"""Validate syntax of --pdbcls option."""
try:
modname, classname = value.split(":")
- except ValueError:
+ except ValueError as e:
raise argparse.ArgumentTypeError(
"{!r} is not in the format 'modname:classname'".format(value)
- )
+ ) from e
return (modname, classname)
@@ -130,7 +130,7 @@ class pytestPDB:
value = ":".join((modname, classname))
raise UsageError(
"--pdbcls: could not import {!r}: {}".format(value, exc)
- )
+ ) from exc
else:
import pdb