Merge "Don't run the test if _setup() fails"

This commit is contained in:
Jenkins 2015-02-24 23:07:21 +00:00 committed by Gerrit Code Review
commit 8a638ce9d6

View File

@ -90,9 +90,7 @@ def usedb(supported=None, not_supported=None):
log.info('Backend %s is not available, skip it', url) log.info('Backend %s is not available, skip it', url)
continue continue
except Exception as e: except Exception as e:
setup_exception = e raise RuntimeError('Exception during _setup(): %r' % e)
else:
setup_exception = None
try: try:
f(self, *a, **kw) f(self, *a, **kw)
@ -100,15 +98,7 @@ def usedb(supported=None, not_supported=None):
try: try:
self._teardown() self._teardown()
except Exception as e: except Exception as e:
teardown_exception=e raise RuntimeError('Exception during _teardown(): %r' % e)
else:
teardown_exception=None
if setup_exception or teardown_exception:
raise RuntimeError((
'Exception during _setup/_teardown:\n'
'setup: %r\n'
'teardown: %r\n'
)%(setup_exception,teardown_exception))
except Exception: except Exception:
failed_for.append(url) failed_for.append(url)
fail = sys.exc_info() fail = sys.exc_info()