本文整理匯總了Python中doctest.DocTestRunner.DIVIDER方法的典型用法代碼示例。如果您正苦於以下問題:Python DocTestRunner.DIVIDER方法的具體用法?Python DocTestRunner.DIVIDER怎麽用?Python DocTestRunner.DIVIDER使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類doctest.DocTestRunner
的用法示例。
在下文中一共展示了DocTestRunner.DIVIDER方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DTC_runTest
# 需要導入模塊: from doctest import DocTestRunner [as 別名]
# 或者: from doctest.DocTestRunner import DIVIDER [as 別名]
def DTC_runTest(self):
test = self._dt_test
old = sys.stdout
new = StringIO()
optionflags = self._dt_optionflags
if not (optionflags & REPORTING_FLAGS):
# The option flags don't include any reporting flags,
# so add the default reporting flags
optionflags |= _unittest_reportflags
# Patching doctestcase to enable verbose mode
global g_doctest_verbose
runner = DocTestRunner(optionflags=optionflags,
checker=self._dt_checker,
verbose=g_doctest_verbose)
# End of patch
try:
runner.DIVIDER = "-"*70
failures, tries = runner.run(
test, out=new.write, clear_globs=False)
finally:
sys.stdout = old
if failures:
raise self.failureException(self.format_failure(new.getvalue()))
elif g_doctest_verbose:
print new.getvalue()