提交 99af5079 编写于 作者: L Lukáš Doktor

Test: Turn `params` into a property

This change should decrease the probability of users accidentally
overriding `Test.params` while keeping the usage the same. There is one
caveat and that is Avocado-vt, which modifies `self.params`, which is
not that simple anymore. I have a fix for it, but the problem is it is
not backward compatible and it can only be changed to
forward-compatible. We should consider whether the benefit of having
this "a bit" protected is greater than backward incompatible change with
Avocado-vt (and possibly other "nasty" user's tests)
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 ba2439b1
......@@ -225,9 +225,9 @@ class Test(unittest.TestCase):
params = []
elif isinstance(params, tuple):
params, mux_path = params[0], params[1]
self.params = varianter.AvocadoParams(params, self.name,
mux_path,
self.default_params)
self.__params = varianter.AvocadoParams(params, self.name,
mux_path,
self.default_params)
default_timeout = getattr(self, "timeout", None)
self.timeout = self.params.get("timeout", default=default_timeout)
......@@ -288,6 +288,13 @@ class Test(unittest.TestCase):
"""
return self.__outputdir
@property
def params(self):
"""
Parameters of this test (AvocadoParam instance)
"""
return self.__params
@property
def basedir(self):
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册