提交 a7b96c49 编写于 作者: C Cleber Rosa

Job: simplify selection of test runner

The logic of _make_test_runner() is too simple, and can be further
simplified, to justify a separate method.  Referring back to the
implementation of _make_test_runner() makes reading the code harder
IMO, so let's inline it.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 bd281c62
......@@ -301,15 +301,6 @@ class Job(object):
sysinfo_dir = path.init_dir(self.logdir, 'sysinfo')
self.sysinfo = sysinfo.SysInfo(basedir=sysinfo_dir)
def _make_test_runner(self):
if hasattr(self.args, 'test_runner'):
test_runner_class = self.args.test_runner
else:
test_runner_class = runner.TestRunner
self.test_runner = test_runner_class(job=self,
result=self.result)
def _make_test_suite(self, references=None):
"""
Prepares a test suite to be used for running tests
......@@ -487,7 +478,8 @@ class Job(object):
raise exceptions.OptionValidationError("Unable to parse "
"variant: %s" % details)
self._make_test_runner()
runner_klass = getattr(self.args, 'test_runner', runner.TestRunner)
self.test_runner = runner_klass(job=self, result=self.result)
self._start_sysinfo()
self._log_job_debug_info(variant)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册