提交 9d10b55f 编写于 作者: C Cleber Rosa

avocado/core/runner.py: remove useless conditional on _template_to_factory

Any non-empty tupple will evaluate to True, even ones filled with
empty strings, None, False, etc.

Let's remove this useless conditional.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 89059043
......@@ -515,25 +515,22 @@ class TestRunner(object):
:return: tuple(new_test_factory, applied_variant)
"""
params = variant.get("variant"), variant.get("mux_path")
if params:
if "params" in template[1]:
if not varianter.is_empty_variant(params[0]):
msg = ("Specifying test params from test loader and "
"from varianter at the same time is not yet "
"supported. Please remove either variants defined"
"by the varianter (%s) or make the test loader of"
"test %s to not to fill variants."
% (variant, template))
raise NotImplementedError(msg)
params = template[1]["params"]
variant_id = varianter.generate_variant_id(params[0])
return template, {"variant": params[0],
"variant_id": variant_id,
"mux_path": params[1]}
factory = [template[0], template[1].copy()]
factory[1]["params"] = params
else:
factory = template
if "params" in template[1]:
if not varianter.is_empty_variant(params[0]):
msg = ("Specifying test params from test loader and "
"from varianter at the same time is not yet "
"supported. Please remove either variants defined"
"by the varianter (%s) or make the test loader of"
"test %s to not to fill variants."
% (variant, template))
raise NotImplementedError(msg)
params = template[1]["params"]
variant_id = varianter.generate_variant_id(params[0])
return template, {"variant": params[0],
"variant_id": variant_id,
"mux_path": params[1]}
factory = [template[0], template[1].copy()]
factory[1]["params"] = params
return factory, variant
def _iter_suite(self, test_suite, variants, execution_order):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册