本文整理汇总了Python中tcmessages.TeamcityServiceMessages.testCount方法的典型用法代码示例。如果您正苦于以下问题:Python TeamcityServiceMessages.testCount方法的具体用法?Python TeamcityServiceMessages.testCount怎么用?Python TeamcityServiceMessages.testCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tcmessages.TeamcityServiceMessages
的用法示例。
在下文中一共展示了TeamcityServiceMessages.testCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TeamcityTestListener
# 需要导入模块: from tcmessages import TeamcityServiceMessages [as 别名]
# 或者: from tcmessages.TeamcityServiceMessages import testCount [as 别名]
class TeamcityTestListener(TestListener):
def __init__(self):
self.messages = TeamcityServiceMessages(prepend_linebreak=True)
def on_test_suite_start(self, test_suite):
self.messages.testMatrixEntered()
self.messages.testCount(len(test_suite.test_cases))
def on_test_suite_finish(self, test_suite):
pass
def on_test_class_start(self, test_class):
self.messages.testSuiteStarted(suiteName=test_class.full_name)
def on_test_class_finish(self, test_class):
self.messages.testSuiteFinished(suiteName=test_class.full_name)
def on_test_group_start(self, test_group):
if not hasattr(test_group.test_class, "is_group_feature_used") or test_group.test_class.is_group_feature_used:
self.messages.testSuiteStarted(suiteName=test_group.name)
def on_test_group_finish(self, test_group):
if not hasattr(test_group.test_class, "is_group_feature_used") or test_group.test_class.is_group_feature_used:
self.messages.testSuiteFinished(suiteName=test_group.name)
def on_test_case_start(self, test_case):
self.messages.testStarted(testName=test_case.name, location=test_case.location)
def on_test_case_finish(self, test_case):
if test_case.status == TestCaseStatus.FAILED:
self.messages.testFailed(testName=test_case.name)
elif test_case.status == TestCaseStatus.SKIPPED:
self.messages.testIgnored(testName=test_case.name)
self.messages.testFinished(testName=test_case.name, duration=int(test_case.elapsed_time * 1000.0))