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


Python TestResult.addSuccess方法代码示例

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


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

示例1: _testrun

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
    def _testrun(self):
        """
        Start a Testrun and populate the Publishers

        @rtype: C{unittest.TestResult}
        @return: A TestResult 
        """    
        testrun_result = TestResult()
        try:
            publishers = self._publishers
            testrun = Testrun(self.is_hw_enabled,
                              self.is_host_enabled,
                              self.is_chroot_enabled)
            taskrunner = self.taskrunner

            #FIXME: Cheap hack to make testable
            testrun.run_test = taskrunner.run
            testrun_result.addSuccess(TestCase)if testrun.run() else \
                  testrun_result.addFailure(TestCase, (None, None, None))
        except Exception, err:
            er_type, value, traceback = sys.exc_info()
            LOG.error(str(value) or "Testrun Error", exc_info=err)
            publishers.set_exception(value)
            testrun_result.addError(TestCase, (er_type, value, traceback))
            if DEBUG:
                raise
开发者ID:mileskin,项目名称:ots-mirror,代码行数:28,代码来源:hub.py

示例2: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     "Called when a test has completed successfully"
     TestResult.addSuccess(self, test)
     if self.verbose:
         self.stream.write('ok\n')
     else:
         self.stream.write('.')
         self.stream.flush()
开发者ID:jimmysitu,项目名称:pyclewn,代码行数:10,代码来源:test_support.py

示例3: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     self.success_count += 1
     TestResult.addSuccess(self, test)
     output = self.complete_output()
     self.result.append((0, test, output, ""))
     if self.verbosity > 1:
         sys.stderr.write("ok ")
         sys.stderr.write(str(test))
         sys.stderr.write("\n")
     else:
         sys.stderr.write(".")
开发者ID:dash0002,项目名称:HTMLTestRunner,代码行数:13,代码来源:HTMLTestRunner.py

示例4: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
     if self.showAll:
         self.stream.writeln("ok")
     elif self.dots:
         context = get_context(test)
         if context:
             self.stream.writeln("")
             self.stream.writeln(context)
         self.stream.write('.')
         self.stream.flush()
开发者ID:kumar303,项目名称:nose-nicedots,代码行数:13,代码来源:plugin.py

示例5: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     """When a successful result is written in the superclass, it's result
     is described as ok.  Here we're altering it to write out 'PASS'.
     """
     TestResult.addSuccess(self, test)
     if self.showAll:
         self.stream.writeln("PASS")
     elif self.dots:
         self.stream.write('.')
     log.result("#" * 50)
     log.result("%s: PASS" % test._testMethodName)
     print "%s: PASS" % test._testMethodName
     log.result("#" * 50)
开发者ID:muttu2244,项目名称:MyPython,代码行数:15,代码来源:StokeTest.py

示例6: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
     if self.showAll:
         self.stream.writeln("ok")
     elif self.dots:
         context = get_context(test)
         if context:
             self.stream.writeln("")
             context_descriptor = self.getDescription(test)
             this_file  = context_descriptor.split(':')[0]
             this_class = context_descriptor.split(":")[1].split(".")[0]
             self.stream.writeln(this_file + ':' + this_class)
         self.stream.write('.')
         self.stream.flush()
开发者ID:kmanalo,项目名称:nose-nicedots,代码行数:16,代码来源:plugin.py

示例7: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
     if self.showAll:
         self.stream.writeln(self.ok_string)
     elif self.dots:
         self.stream.write('.')
开发者ID:christianurich,项目名称:VIBe2UrbanSim,代码行数:8,代码来源:opus_test_runner.py

示例8: addSuccess

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

示例9: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
     self._lastWas = 'success'
开发者ID:ask,项目名称:django-test-extensions,代码行数:5,代码来源:xmloutput.py

示例10: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test, *k):
     TestResult.addSuccess(self, test)
     
     self.output.write("ok\n")
开发者ID:aaronb-inova,项目名称:teamcity-python,代码行数:6,代码来源:unittestpy.py

示例11: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
     if not self.iterations:
         self.stream.write("ok\n")
开发者ID:camp0,项目名称:incc,代码行数:6,代码来源:testrunner.py

示例12: addSuccess

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

示例13: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
开发者ID:ashanco,项目名称:intellij-community,代码行数:4,代码来源:tcunittest.py

示例14: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     TestResult.addSuccess(self, test)
     if self._logging:
         self._writeToStream("\tResult: ")
     self._writeToStream("OK", eColors.Green)
开发者ID:edwardbadboy,项目名称:sanlock-ubuntu,代码行数:7,代码来源:testRunner.py

示例15: addSuccess

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSuccess [as 别名]
 def addSuccess(self, test):
     _TestResult.addSuccess(self, test)
     filename = inspect.getfile(test.__class__)
     testname = test._testMethodName
     self.stream.writeln("TEST-PASS | {0} | {1}".format(filename, testname))
开发者ID:70599,项目名称:Waterfox,代码行数:7,代码来源:mozunit.py


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