summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/job.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/resmokelib/testing/job.py')
-rw-r--r--buildscripts/resmokelib/testing/job.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/buildscripts/resmokelib/testing/job.py b/buildscripts/resmokelib/testing/job.py
index 5707a218a1a..3de11ad3278 100644
--- a/buildscripts/resmokelib/testing/job.py
+++ b/buildscripts/resmokelib/testing/job.py
@@ -220,18 +220,18 @@ class Job(object): # pylint: disable=too-many-instance-attributes
except errors.StopExecution:
raise
- except errors.ServerFailure:
+ except errors.ServerFailure as exc:
self.logger.exception("%s marked as a failure by a hook's before_test.",
test.short_description())
self._fail_test(test, sys.exc_info(), return_code=2)
- raise errors.StopExecution("A hook's before_test failed")
+ raise errors.StopExecution("A hook's before_test failed") from exc
- except errors.TestFailure:
+ except errors.TestFailure as exc:
self.logger.exception("%s marked as a failure by a hook's before_test.",
test.short_description())
self._fail_test(test, sys.exc_info(), return_code=1)
if self.suite_options.fail_fast:
- raise errors.StopExecution("A hook's before_test failed")
+ raise errors.StopExecution("A hook's before_test failed") from exc
except:
# Record the before_test() error in 'self.report'.
@@ -253,18 +253,18 @@ class Job(object): # pylint: disable=too-many-instance-attributes
except errors.StopExecution:
raise
- except errors.ServerFailure:
+ except errors.ServerFailure as exc:
self.logger.exception("%s marked as a failure by a hook's after_test.",
test.short_description())
self.report.setFailure(test, return_code=2)
- raise errors.StopExecution("A hook's after_test failed")
+ raise errors.StopExecution("A hook's after_test failed") from exc
- except errors.TestFailure:
+ except errors.TestFailure as exc:
self.logger.exception("%s marked as a failure by a hook's after_test.",
test.short_description())
self.report.setFailure(test, return_code=1)
if self.suite_options.fail_fast:
- raise errors.StopExecution("A hook's after_test failed")
+ raise errors.StopExecution("A hook's after_test failed") from exc
except:
self.report.setError(test)