本文整理汇总了Python中unittest.TestResult.addSkip方法的典型用法代码示例。如果您正苦于以下问题:Python TestResult.addSkip方法的具体用法?Python TestResult.addSkip怎么用?Python TestResult.addSkip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unittest.TestResult
的用法示例。
在下文中一共展示了TestResult.addSkip方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, reason):
TestResult.addSkip(self, test, reason)
if self.verbose:
self.stream.write("SKIPPED: %s [%s]%s" % (test, reason,
os.linesep))
self.stream.flush()
self.countcall()
示例2: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, reason):
"""Called when a test is skipped."""
TestResult.addSkip(self, test, reason)
if self.verbose:
self.stream.write('skipped (%s)\n' % reason)
else:
self.stream.write('s')
self.stream.flush()
示例3: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, reason):
"""
Public method called if a test was skipped.
@param test reference to the test object
@param reason reason for skipping the test (string)
"""
TestResult.addSkip(self, test, reason)
self.parent.write('{0}{1}\n'.format(
ResponseUTTestSkipped,
str((str(test), reason, test.id()))))
示例4: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, err):
self.skip_count += 1
TestResult.addSkip(self, test, err)
_exc_str = self.skipped[-1][1]
output = self.complete_output()
self.result.append((3, test, output, _exc_str))
if self.verbosity > 1:
sys.stderr.write("S ")
sys.stderr.write(str(test))
sys.stderr.write("\n")
else:
sys.stderr.write("S")
示例5: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, reason):
_TestResult.addSkip(self, test, reason)
self.printStatus('TEST-SKIP', test)
示例6: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, detail):
if hasattr(TestResult, 'addSkip'):
TestResult.addSkip(self, test, detail)
else:
self.skips.append((test, detail))
self.addAResult(test, SKIPPED, 'SKIPPED', detail)
示例7: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, detail):
if hasattr(TestResult, 'addSkip'):
TestResult.addSkip(self, test, detail)
else:
self.skips.append((test, detail))
示例8: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, reason):
TestResult.addSkip(self, test, reason)
self._color_print("skipped: %s" % reason, BROWN)
示例9: addSkip
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import addSkip [as 别名]
def addSkip(self, test, reason):
UnitTestResult.addSkip(self, test, reason)
if self.showAll:
self._errWrite('skip {0!r}\n'.format(reason))
elif self.dots:
self._errWrite('s')