Use skipTest from testtools instead of inherited Exception
SkipTest is raised if there is no func_test section in the Swift test config file. However, the currently raised Exception will result in a failed test, not in a test marked as skipped. Since we already use testtools we can use the included skipTest easily. Change-Id: I1bbb1f9dbe31fb0698d774550708d1196b266625
This commit is contained in:
@@ -66,7 +66,3 @@ class ClientException(Exception):
|
|||||||
b += ' [first 60 chars of response] %s' \
|
b += ' [first 60 chars of response] %s' \
|
||||||
% self.http_response_content[:60]
|
% self.http_response_content[:60]
|
||||||
return b and '%s: %s' % (a, b) or a
|
return b and '%s: %s' % (a, b) or a
|
||||||
|
|
||||||
|
|
||||||
class SkipTest(Exception):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -70,8 +70,7 @@ class TestFunctional(testtools.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestFunctional, self).setUp()
|
super(TestFunctional, self).setUp()
|
||||||
if self.skip_tests:
|
if self.skip_tests:
|
||||||
raise swiftclient.exceptions.SkipTest(
|
self.skipTest('SKIPPING FUNCTIONAL TESTS DUE TO NO CONFIG')
|
||||||
'SKIPPING FUNCTIONAL TESTS DUE TO NO CONFIG')
|
|
||||||
|
|
||||||
self.conn = swiftclient.Connection(
|
self.conn = swiftclient.Connection(
|
||||||
self.auth_url, self.account_username, self.password,
|
self.auth_url, self.account_username, self.password,
|
||||||
|
|||||||
Reference in New Issue
Block a user