Merge "Call tearDownClass when handling skip exception on setUpClass"
diff --git a/tempest/test.py b/tempest/test.py
index 438f4d9..1e5cd19 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -203,6 +203,10 @@
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()
diff --git a/tempest/tests/test_test.py b/tempest/tests/test_test.py
index ad0793c..a2e0efd 100644
--- a/tempest/tests/test_test.py
+++ b/tempest/tests/test_test.py
@@ -538,7 +538,8 @@
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):