summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests
diff options
context:
space:
mode:
authortautaus <sunt9751@gmail.com>2021-01-31 21:56:46 -0500
committertautaus <sunt9751@gmail.com>2021-01-31 21:56:46 -0500
commitb62ffc5a3584f6f946b7fbc37336d2cd63ea943d (patch)
tree864ab17047d21fc302780cd0c3675e21325dec8e /numpy/linalg/tests
parentf55f5d45518c2f83271330041b982e55dcd6bbf9 (diff)
downloadnumpy-b62ffc5a3584f6f946b7fbc37336d2cd63ea943d.tar.gz
See #15986. Chain exceptions in linalg
Diffstat (limited to 'numpy/linalg/tests')
-rw-r--r--numpy/linalg/tests/test_build.py4
-rw-r--r--numpy/linalg/tests/test_linalg.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/numpy/linalg/tests/test_build.py b/numpy/linalg/tests/test_build.py
index 4859226d9..868341ff2 100644
--- a/numpy/linalg/tests/test_build.py
+++ b/numpy/linalg/tests/test_build.py
@@ -15,8 +15,8 @@ class FindDependenciesLdd:
try:
p = Popen(self.cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
- except OSError:
- raise RuntimeError(f'command {self.cmd} cannot be run')
+ except OSError as e:
+ raise RuntimeError(f'command {self.cmd} cannot be run') from e
def get_dependencies(self, lfile):
p = Popen(self.cmd + [lfile], stdout=PIPE, stderr=PIPE)
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
index 21fab58e1..8a270f194 100644
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -348,10 +348,10 @@ class LinalgTestCase:
try:
case.check(self.do)
- except Exception:
+ except Exception as e:
msg = f'In test case: {case!r}\n\n'
msg += traceback.format_exc()
- raise AssertionError(msg)
+ raise AssertionError(msg) from e
class LinalgSquareTestCase(LinalgTestCase):