本文整理汇总了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)
示例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)
示例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())
示例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 = ""
示例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)
示例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)
示例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')
示例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)