Fix exception causes all over the codebase

This commit is contained in:
Ram Rachum
2020-06-19 12:53:44 +03:00
parent 4cc4ebf3c9
commit dd446bee5e
14 changed files with 38 additions and 34 deletions

View File

@@ -1778,5 +1778,5 @@ def test_conftest_import_error_repr(tmpdir):
):
try:
raise RuntimeError("some error")
except Exception:
raise ConftestImportFailure(path, sys.exc_info())
except Exception as e:
raise ConftestImportFailure(path, sys.exc_info()) from e

View File

@@ -534,8 +534,8 @@ def test_outcomeexception_passes_except_Exception() -> None:
with pytest.raises(outcomes.OutcomeException):
try:
raise outcomes.OutcomeException("test")
except Exception:
raise NotImplementedError()
except Exception as e:
raise NotImplementedError from e
def test_pytest_exit() -> None: