avocado.test: Save log contents in Test.text_output

At the end of a test, in order to make xunit information
richer, we can simply save the log contents of a test
in Test.text_output. It can then be recorded in the
xunit file conveniently.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 3478591d
......@@ -102,6 +102,7 @@ class Test(unittest.TestCase):
self.fail_reason = None
self.fail_class = None
self.traceback = None
self.text_output = None
self.time_elapsed = None
unittest.TestCase.__init__(self)
......@@ -225,6 +226,8 @@ class Test(unittest.TestCase):
end_time = time.time()
self.time_elapsed = end_time - start_time
self.report()
with open(self.logfile, 'r') as log_file_obj:
self.text_output = log_file_obj.read()
self.stop_logging()
def report(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册