Merge "Permits a list of values for the "type=" tests attribute"

This commit is contained in:
Jenkins 2013-05-14 18:25:35 +00:00 committed by Gerrit Code Review
commit 0e98675c17

View File

@ -37,13 +37,12 @@ def attr(*args, **kwargs):
"""
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)
if 'type' in kwargs and isinstance(kwargs['type'], str):
f = testtools.testcase.attr(kwargs['type'])(f)
elif 'type' in kwargs and isinstance(kwargs['type'], list):
for attr in kwargs['type']:
f = testtools.testcase.attr(attr)(f)
return nose.plugins.attrib.attr(*args, **kwargs)(f)
return decorator