Remove duplicate exception tracebacks from test reporting

Change-Id: Idae9c7edf55a33f9d58dc72213aa88c52130c5c3
This commit is contained in:
Federico Ressi 2020-08-07 16:21:14 +02:00
parent d3b5eb36b3
commit 33d90c7f2b
2 changed files with 10 additions and 10 deletions

View File

@ -92,12 +92,12 @@ class ExceptionInfo(collections.namedtuple('ExceptionInfo',
def __enter__(self):
return self
def __bool__(self):
return self.type is not None
def __exit__(self, _type, _value, _traceback):
if self.reraise_on_exit:
if _type is not None:
LOG.exception("Exception occurred while handling %s(%s) "
"exception.", self.type, self.value)
self.reraise()
self.reraise()
def reraise(self):
if self.type is not None:

View File

@ -80,9 +80,9 @@ class RetryAttempt(object):
return max(0, self.count - self.number)
def check_count_left(self) -> _time.Seconds:
with _exception.exc_info():
if self.count_left == 0:
raise RetryCountLimitError(attempt=self)
if self.count_left == 0:
_exception.exc_info().reraise()
raise RetryCountLimitError(attempt=self)
return self.count_left
@property
@ -93,9 +93,9 @@ class RetryAttempt(object):
return max(0., self.timeout - self.elapsed_time)
def check_time_left(self) -> _time.Seconds:
with _exception.exc_info():
if self.time_left == 0.:
raise RetryTimeLimitError(attempt=self)
if self.time_left == 0.:
_exception.exc_info().reraise()
raise RetryTimeLimitError(attempt=self)
return self.time_left
def check_limits(self):