Fix raise syntax in test.py for python3 compat
The raise syntax was changed in python3 so the usage of passing in
the separate components as different params to raise will not work
when running on python 3. This commit updates it to use a syntax
which is compatible with python3.
Change-Id: I5cb9979e8ba8e324efb95feec33c23238dffade5
diff --git a/tempest/test.py b/tempest/test.py
index 2d5e94a..9d1b807 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -267,7 +267,7 @@
etype, cls.__name__))
cls.tearDownClass()
try:
- raise etype, value, trace
+ six.reraise(etype, value, trace)
finally:
del trace # to avoid circular refs
@@ -305,7 +305,7 @@
# the first one
if re_raise and etype is not None:
try:
- raise etype, value, trace
+ six.reraise(etype, value, trace)
finally:
del trace # to avoid circular refs
diff --git a/tempest/thirdparty/boto/test.py b/tempest/thirdparty/boto/test.py
index 4485972..1ff4dee 100644
--- a/tempest/thirdparty/boto/test.py
+++ b/tempest/thirdparty/boto/test.py
@@ -252,9 +252,9 @@
except exception.BotoServerError as exc:
error_msg = excMatcher.match(exc)
if error_msg is not None:
- raise self.failureException, error_msg
+ raise self.failureException(error_msg)
else:
- raise self.failureException, "BotoServerError not raised"
+ raise self.failureException("BotoServerError not raised")
@classmethod
def resource_cleanup(cls):