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


Python TestResult.startTest方法代码示例

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


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

示例1: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     "Called before execute each test method."
     self.start_time = time.time()
     TestResult.startTest(self, test)
     
     if self.showAll:
         self.stream.write('  ' + self.getDescription(test))
         self.stream.write(" ... ")
开发者ID:garsue,项目名称:unittest-xml-reporting,代码行数:10,代码来源:__init__.py

示例2: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     TestResult.startTest(self, test)
     # just one buffer for both stdout and stderr
     stdout_redirector.fp = self.outputBuffer
     stderr_redirector.fp = self.outputBuffer
     self.stdout0 = sys.stdout
     self.stderr0 = sys.stderr
     sys.stdout = stdout_redirector
     sys.stderr = stderr_redirector
开发者ID:dash0002,项目名称:HTMLTestRunner,代码行数:11,代码来源:HTMLTestRunner.py

示例3: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     """
     Method called at the start of a test.
     
     @param test Reference to the test object
     """
     TestResult.startTest(self, test)
     self.parent.write('{0}{1}\n'.format(ResponseUTStartTest,
         str((str(test), test.shortDescription()))))
开发者ID:usc-bbdl,项目名称:R01_HSC_cadaver_system,代码行数:11,代码来源:DCTestResult.py

示例4: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     """
     Method called at the start of a test.
     
     @param test Reference to the test object
     """
     TestResult.startTest(self, test)
     self.parent.write('%s%s\n' % (ResponseUTStartTest,
         unicode((unicode(test), test.shortDescription()))))
开发者ID:sourcepole,项目名称:qgis-remote-debug,代码行数:11,代码来源:DCTestResult.py

示例5: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
    def startTest(self, test):  #  CONSIDER  why are there 2 startTests in here?
        self._startTime = time.time()
        test._extraXML = ''
        test._extraAssertions = []
        TestResult.startTest(self, test)
        self.stream.write('<testcase classname="%s' % test.__class__.__name__ + '" name="%s' % test.id().split('.')[-1] + '"')
        desc = test.shortDescription()

        if desc:
            desc = _cleanHTML(desc)
            self.stream.write(' desc="%s"' % desc)
开发者ID:akaihola,项目名称:django-test-extensions,代码行数:13,代码来源:xmloutput.py

示例6: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
    def startTest(self, test):  #  CONSIDER  why are there 2 startTests in here?
        self._startTime = time.time()
        test._extraXML = ''
        test._extraAssertions = []
        TestResult.startTest(self, test)
        self.stream.write('<testcase classname="%s' % test.__class__.__name__ + '" name="%s' % test.id().split('.')[-1] + '"')
        desc = (test._testMethodDoc or '').strip()
        # desc = test.shortDescription()  #  CONSIDER why did this fail?

        if desc:
            desc = _cleanHTML(desc)
            desc = desc.replace('\n', '&#10;')
            self.stream.write(' desc="%s"' % desc)
开发者ID:cukeros,项目名称:django-test-extensions,代码行数:15,代码来源:xmloutput.py

示例7: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     TestResult.startTest(self, test)
     methodName = get_test_method_name(test)
     methodClass = _strclass(test.__class__)
     if methodClass not in self._testsuites:
         self._testsuite = self.xml.createElement('testsuite')
         self._testsuite.setAttribute('name', '%s' % methodClass)
         self._testsuites[methodClass] = self._testsuite
         self.xml.documentElement.appendChild(self._testsuite)
     else:
         self._testsuite = self._testsuites[methodClass]
     self._testcase_xml = self.xml.createElement('testcase')
     self._testcase_xml.setAttribute('name', '%s' % methodName)
     self._startTime = time.time()
开发者ID:christianurich,项目名称:VIBe2UrbanSim,代码行数:16,代码来源:opus_test_runner.py

示例8: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     "Called when the given test is about to be run. Resets global flags."
     self.last_errors.fill(False)
     self.last_failed.fill(False)
     TestResult.startTest(self, test)
开发者ID:eojons,项目名称:gpaw-scme,代码行数:7,代码来源:parunittest.py

示例9: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     self._startTime = time.time()
     TestResult.startTest(self, test)
     self.stream.write('<testcase classname="%s' % test.__class__.__name__ + '" name="%s' % test.id().split('.')[-1] + '"')
开发者ID:ask,项目名称:django-test-extensions,代码行数:6,代码来源:xmloutput.py

示例10: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     TestResult.startTest(self, test)
     for listener in self.listeners:
         listener.startTest(test)
开发者ID:leosoto,项目名称:Pydev,代码行数:6,代码来源:unittest2.py

示例11: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     test._subunit_started = True
     #instead of calling TestProtocolClient.startTest(self, test), 
     #which uses test.id(), we follow what vanilla unittest does
     self._stream.write("test: %s\n" % self.getDescription(test))
     TestResult.startTest(self, test)
开发者ID:liucougar,项目名称:nose-subunit,代码行数:8,代码来源:sunit.py

示例12: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     UnitTestResult.startTest(self, test)
     if self.showAll:
         self._errWrite(str(test))
         self._errWrite(' ... ')
开发者ID:seecr,项目名称:meresco-triplestore,代码行数:7,代码来源:testrunner.py

示例13: startTest

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

示例14: startTest

# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import startTest [as 别名]
 def startTest(self, test):
     "Called when the given test is about to be run"
     TestResult.startTest(self, test)
     if self.verbose:
         self.stream.write(get_description(test))
         self.stream.write(' ... ')
开发者ID:jimmysitu,项目名称:pyclewn,代码行数:8,代码来源:test_support.py

示例15: startTest

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


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