本文整理汇总了Python中avocado.result.TestResult.end_test方法的典型用法代码示例。如果您正苦于以下问题:Python TestResult.end_test方法的具体用法?Python TestResult.end_test怎么用?Python TestResult.end_test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类avocado.result.TestResult
的用法示例。
在下文中一共展示了TestResult.end_test方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, test):
"""
Called when the given test has been run.
:param test: :class:`avocado.test.Test` instance.
"""
TestResult.end_test(self, test)
示例2: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, test):
"""
Record an end test event, accord to the given test status.
"""
TestResult.end_test(self, test)
if test.status == 'PASS':
self.xml.add_success(test)
if test.status == 'TEST_NA':
self.xml.add_skip(test)
if test.status == 'FAIL':
self.xml.add_failure(test)
if test.status == 'ERROR':
self.xml.add_error(test)
示例3: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, test):
"""
Called when the given test has been run.
:param test: an instance of :class:`avocado.test.Test`.
"""
TestResult.end_test(self, test)
self.stream.stop_file_logging()
t = {'test': test.tagged_name,
'url': test.name,
'time': test.time_elapsed,
'status': test.status,
}
self.json['tests'].append(t)
示例4: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, state):
"""
Record an end test event, accord to the given test status.
:param state: result of :class:`avocado.test.Test.get_state`.
:type state: dict
"""
TestResult.end_test(self, state)
if state['status'] in ('PASS', 'WARN'):
self.xml.add_success(state)
elif state['status'] == 'TEST_NA':
self.xml.add_skip(state)
elif state['status'] == 'FAIL':
self.xml.add_failure(state)
elif state['status'] == 'ERROR':
self.xml.add_error(state)
示例5: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, state):
"""
Called when the given test has been run.
:param state: result of :class:`avocado.test.Test.get_state`.
:type state: dict
"""
TestResult.end_test(self, state)
if 'job_id' not in self.json:
self.json['job_id'] = state['job_unique_id']
t = {'test': state['tagged_name'],
'url': state['name'],
'time': state['time_elapsed'],
'status': state['status'],
'whiteboard': state['whiteboard'],
}
self.json['tests'].append(t)
示例6: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, state):
"""
Called when the given test has been run.
:param state: result of :class:`avocado.test.Test.get_state`.
:type state: dict
"""
TestResult.end_test(self, state)
if state['fail_reason'] is None:
state['fail_reason'] = ''
else:
state['fail_reason'] = str(state['fail_reason'])
t = {'test': state['tagged_name'],
'url': state['name'],
'time_start': state['time_start'],
'time_end': state['time_end'],
'time': state['time_elapsed'],
'status': state['status'],
'fail_reason': state['fail_reason'],
'whiteboard': state['whiteboard'],
'logdir': state['logdir'],
'logfile': state['logfile']
}
self.json['tests'].append(t)
示例7: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, state):
self.lazy_init_journal(state)
TestResult.end_test(self, state)
self._record_status(state, "ENDED")
示例8: end_test
# 需要导入模块: from avocado.result import TestResult [as 别名]
# 或者: from avocado.result.TestResult import end_test [as 别名]
def end_test(self, test):
TestResult.end_test(self, test)
self._record_status(test, "ENDED")