当前位置: 首页>>代码示例>>Python>>正文


Python TestResult.stopTest方法代码示例

本文整理汇总了Python中unittest.TestResult.stopTest方法的典型用法代码示例。如果您正苦于以下问题:Python TestResult.stopTest方法的具体用法?Python TestResult.stopTest怎么用?Python TestResult.stopTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在unittest.TestResult的用法示例。


在下文中一共展示了TestResult.stopTest方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
    def stopTest(self, test):
        stopTime = time.time()
        deltaTime = stopTime - self._startTime
        TestResult.stopTest(self, test)
        self.stream.write(' time="%.3f"' % deltaTime)
        self.stream.write('>')
        if self._lastWas != 'success':
            if self._lastWas == 'error':
                self.stream.write(self._errorsAndFailures)
            elif self._lastWas == 'failure':
                self.stream.write(self._errorsAndFailures)
            else:
                assert(False)

        seen = {}

        for assertion in test._extraAssertions:
            if not seen.has_key(assertion):
                self._addAssertion(assertion[:110]) # :110 avoids tl;dr TODO use a lexical truncator
                seen[assertion] = True

        self.stream.write('</testcase>')
        self._errorsAndFailures = ""

        if test._extraXML != '':
            self.stream.write(test._extraXML)
开发者ID:cukeros,项目名称:django-test-extensions,代码行数:28,代码来源:xmloutput.py

示例2: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
 def stopTest(self, test):
     """Called when the given test has been run. If the stop flag was
     raised beforehand, will broadcast to raise flags for global stop."""
     stop_flags = np.empty(self.comm.size, dtype=bool)
     self.comm.all_gather(np.array([self.shouldStop]), stop_flags)
     self.shouldStop = stop_flags.any()
     TestResult.stopTest(self, test)
开发者ID:eojons,项目名称:gpaw-scme,代码行数:9,代码来源:parunittest.py

示例3: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
    def stopTest(self, test):
        """
        Method called at the end of a test.
        
        @param test Reference to the test object
        """
        TestResult.stopTest(self, test)
        self.parent.write('{0}\n'.format(ResponseUTStopTest))
        
        # ensure that pending input is processed
        rrdy, wrdy, xrdy = select.select([self.parent.readstream],[],[], 0.01)

        if self.parent.readstream in rrdy:
            self.parent.readReady(self.parent.readstream.fileno())
开发者ID:usc-bbdl,项目名称:R01_HSC_cadaver_system,代码行数:16,代码来源:DCTestResult.py

示例4: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
 def stopTest(self, test):
     stopTime = time.time()
     deltaTime = stopTime - self._startTime
     TestResult.stopTest(self, test)
     self.stream.write(' time="%.3f"' % deltaTime)
     if self._lastWas == 'success':
         self.stream.write('/>')
     else:
         self.stream.write('>')
         if self._lastWas == 'error':
             self.stream.write(self._errorsAndFailures)
         elif self._lastWas == 'failure':
             self.stream.write(self._errorsAndFailures)
         else:
             assert(False)
         self.stream.write('</testcase>')
     self._errorsAndFailures = ""
开发者ID:ask,项目名称:django-test-extensions,代码行数:19,代码来源:xmloutput.py

示例5: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
 def stopTest(self, test):
     TestResult.stopTest(self, test)
     self.step.setProgress('tests', self.testsRun)
开发者ID:fcofdez,项目名称:buildbot,代码行数:5,代码来源:subunit.py

示例6: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
 def stopTest(self, test):
     TestResult.stopTest(self, test)
     self._writeToStream("\n")
     self.printTestErrLog(test, 3)
开发者ID:edwardbadboy,项目名称:sanlock-ubuntu,代码行数:6,代码来源:testRunner.py

示例7: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
 def stopTest(self, test):
     TestResult.stopTest(self, test)
     self.logger.debug('STOP')
开发者ID:borqsat,项目名称:smartframe,代码行数:5,代码来源:testrunner.py

示例8: stopTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import stopTest [as 别名]
 def stopTest(self, test):
     self.results_log[test.id()][2] = time.time() - self.test_start_at
     return TestResult.stopTest(self, test)
开发者ID:simbha,项目名称:GAE-appswell,代码行数:5,代码来源:testing.py


注:本文中的unittest.TestResult.stopTest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。