當前位置: 首頁>>代碼示例>>Python>>正文


Python TeamcityServiceMessages.testCount方法代碼示例

本文整理匯總了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))
開發者ID:KarlGong,項目名稱:ptest-pycharm-plugin,代碼行數:36,代碼來源:ptestrunner.py


注:本文中的tcmessages.TeamcityServiceMessages.testCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。