Merge "Add generic nose/testtools attr decorator"
diff --git a/tempest/test.py b/tempest/test.py
index 7804e12..58fadeb 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -18,6 +18,7 @@
import logging
import time
+import nose.plugins.attrib
import testtools
from tempest import manager
@@ -25,6 +26,25 @@
LOG = logging.getLogger(__name__)
+def attr(*args, **kwargs):
+ """A decorator which applies the nose and testtools attr decorator
+
+ This decorator applies the nose attr decorator as well as the
+ the testtools.testcase.attr if it is in the list of attributes
+ to testtools we want to apply."""
+
+ def decorator(f):
+ testtool_attributes = ('smoke')
+
+ if 'type' in kwargs and kwargs['type'] in testtool_attributes:
+ return nose.plugins.attrib.attr(*args, **kwargs)(
+ testtools.testcase.attr(kwargs['type'])(f))
+ else:
+ return nose.plugins.attrib.attr(*args, **kwargs)(f)
+
+ return decorator
+
+
class TestCase(testtools.TestCase):
"""