diff options
| author | tautaus <sunt9751@gmail.com> | 2021-01-31 21:56:46 -0500 |
|---|---|---|
| committer | tautaus <sunt9751@gmail.com> | 2021-01-31 21:56:46 -0500 |
| commit | b62ffc5a3584f6f946b7fbc37336d2cd63ea943d (patch) | |
| tree | 864ab17047d21fc302780cd0c3675e21325dec8e /numpy/linalg/tests | |
| parent | f55f5d45518c2f83271330041b982e55dcd6bbf9 (diff) | |
| download | numpy-b62ffc5a3584f6f946b7fbc37336d2cd63ea943d.tar.gz | |
See #15986. Chain exceptions in linalg
Diffstat (limited to 'numpy/linalg/tests')
| -rw-r--r-- | numpy/linalg/tests/test_build.py | 4 | ||||
| -rw-r--r-- | numpy/linalg/tests/test_linalg.py | 4 |
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): |
