Merge "Call tearDownClass when handling skip exception on setUpClass"
This commit is contained in:
commit
420155c234
@ -203,6 +203,10 @@ class BaseTestCase(testtools.testcase.WithAttributes,
|
||||
cls._teardowns.append(('resources', cls.resource_cleanup))
|
||||
cls.resource_setup()
|
||||
except exc as e:
|
||||
# NOTE(dviroel): the exception may be raised after setting up the
|
||||
# user credentials, so we must call tearDownClass to release all
|
||||
# allocated resources.
|
||||
cls.tearDownClass()
|
||||
raise exc_to_raise(e.args)
|
||||
except Exception:
|
||||
etype, value, trace = sys.exc_info()
|
||||
|
@ -538,7 +538,8 @@ class TestTempestBaseTestClassFixtures(base.TestCase):
|
||||
result = LoggingTestResult(log)
|
||||
suite.run(result)
|
||||
# If we trigger a skip condition, teardown is not invoked at all
|
||||
self.assertEqual(self.SETUP_FIXTURES[:2],
|
||||
self.assertEqual((self.SETUP_FIXTURES[:2] +
|
||||
[self.TEARDOWN_FIXTURES[0]]),
|
||||
self.test.fixtures_invoked)
|
||||
|
||||
def test_skip_credentials_fails(self):
|
||||
|
Loading…
Reference in New Issue
Block a user