本文整理匯總了Python中HTMLTestRunner.html方法的典型用法代碼示例。如果您正苦於以下問題:Python HTMLTestRunner.html方法的具體用法?Python HTMLTestRunner.html怎麽用?Python HTMLTestRunner.html使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTMLTestRunner
的用法示例。
在下文中一共展示了HTMLTestRunner.html方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: import HTMLTestRunner [as 別名]
# 或者: from HTMLTestRunner import html [as 別名]
def run(self, test):
"Run the given test case or test suite."
result = _TestResult(self.verbosity)
try:
test(result)
except KeyboardInterrupt:
logging.error("Test Runner interrupted by user")
except Exception:
logging.error(traceback.format_exc())
self.stopTime = datetime.datetime.now().replace(microsecond=0)
self.generateReport(test, result)
totalNbr = result.error_count + result.failure_count + result.skip_count + result.success_count
logging.info('---------------------------------------')
logging.info('Run ' + str(totalNbr) + ' tests in time %s' %(self.stopTime-self.startTime))
logging.info('Error ' + str(result.error_count) +
', Failed ' + str(result.failure_count) +
', Skipped ' + str(result.skip_count) +
', Success ' + str(result.success_count))
if xunitReport:
base = os.path.splitext(self.stream.name)[0] #stream = c:\...\Report.html, base = Report
directory = os.path.dirname(self.stream.name)
xunitFile = base + ".xml"
result.xunit.report(xunitFile)
#copy file for jenkins with the unambiguous location e.i. result directory
#shutil.copy2(xunitFile, os.path.join(directory, '..'))
return result