Don't run the test if _setup() fails

Change-Id: I2c89c98961044f0e0a1d9b4c2eeea190c5830eed
This commit is contained in:
Roman Podoliaka 2015-01-29 19:55:47 +02:00
parent c8c5c4bdd8
commit 5feeaba69f
1 changed files with 2 additions and 12 deletions

View File

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