本文整理汇总了Python中HTMLTestRunner.HTMLTestRunner方法的典型用法代码示例。如果您正苦于以下问题:Python HTMLTestRunner.HTMLTestRunner方法的具体用法?Python HTMLTestRunner.HTMLTestRunner怎么用?Python HTMLTestRunner.HTMLTestRunner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLTestRunner
的用法示例。
在下文中一共展示了HTMLTestRunner.HTMLTestRunner方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generateReport
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def generateReport(self, test, result):
report_attrs = self.getReportAttributes(result)
generator = 'HTMLTestRunner %s' % __version__
stylesheet = self._generate_stylesheet()
heading = self._generate_heading(report_attrs)
report = self._generate_report(result)
ending = self._generate_ending()
output = self.HTML_TMPL % dict(
title = saxutils.escape(self.title),
generator = generator,
stylesheet = stylesheet,
heading = heading,
report = report,
ending = ending,
)
self.stream.write(output.encode('utf8'))
示例2: generateReport
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def generateReport(self, test, result):
report_attrs = self.getReportAttributes(result)
generator = 'HTMLTestRunner %s' % __version__
stylesheet = self._generate_stylesheet()
heading = self._generate_heading(report_attrs)
report = self._generate_report(result)
ending = self._generate_ending()
output = self.HTML_TMPL % dict(
title=saxutils.escape(self.title),
generator=generator,
stylesheet=stylesheet,
heading=heading,
report=report,
ending=ending,
)
self.stream.write(output.encode('utf8'))
示例3: generateReport
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def generateReport(self, test, result):
report_attrs = self.getReportAttributes(result)
generator = 'HTMLTestRunner %s' % __version__
stylesheet = self._generate_stylesheet()
heading = self._generate_heading(report_attrs)
report = self._generate_report(result)
ending = self._generate_ending()
chart = self._generate_chart(result)
output = self.HTML_TMPL % dict(
title = saxutils.escape(self.title),
generator = generator,
stylesheet = stylesheet,
heading = heading,
report = report,
ending = ending,
chart_script = chart
)
self.stream.write(output.encode('utf8'))
示例4: generateReport
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def generateReport(self, test, result):
report_attrs = self.getReportAttributes(result)
generator = 'HTMLTestRunner %s' % __version__
stylesheet = self._generate_stylesheet()
heading = self._generate_heading(report_attrs)
report = self._generate_report(result)
ending = self._generate_ending()
output = self.HTML_TMPL % dict(
title = saxutils.escape(self.title),
generator = generator,
stylesheet = stylesheet,
heading = heading,
report = report,
ending = ending,
)
#in Python3 the write method of stdout need know the encoding
try:
self.stream.write(output)
except TypeError:
self.stream.write(output.encode("utf8"))
示例5: generateReport
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def generateReport(self, test, result):
"""This is a docstring"""
report_attrs = self.getReportAttributes(result)
generator = 'HTMLTestRunner %s' % __version__
stylesheet = self._generate_stylesheet()
heading = self._generate_heading(report_attrs)
report = self._generate_report(result)
ending = self._generate_ending()
output = self.HTML_TMPL % dict(
title = saxutils.escape(self.title),
generator = generator,
stylesheet = stylesheet,
heading = heading,
report = report,
ending = ending,
)
self.stream.write(output.encode('utf8'))
示例6: generateReport
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def generateReport(self, test, result):
report_attrs = self.getReportAttributes(result)
generator = 'HTMLTestRunner %s' % __version__
stylesheet = self._generate_stylesheet()
heading = self._generate_heading(report_attrs)
report = self._generate_report(result)
ending = self._generate_ending()
output = self.HTML_TMPL % dict(
title = saxutils.escape(self.title),
generator = generator,
stylesheet = stylesheet,
heading = heading,
report = report,
ending = ending,
)
#output.as_string()
self.stream.write(output.encode('utf8'))
示例7: runTests
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def runTests(self):
# Pick HTMLTestRunner as the default test runner.
# base class's testRunner parameter is not useful because it means
# we have to instantiate HTMLTestRunner before we know self.verbosity.
if self.testRunner is None:
self.testRunner = HTMLTestRunner(verbosity=self.verbosity)
unittest.TestProgram.runTests(self)
示例8: go
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def go(test_output):
test_output_file = file(test_output, 'wb')
runner = HTMLTestRunner.HTMLTestRunner(
stream=test_output_file,
title='Device Pool Unit Test',
description='Device Pool Unit Test package',
verbosity=2)
super_suite = poolunittest.PoolTestSuite()
super_suite.addTest(pool.suite())
runner.run(super_suite)
示例9: m3
# 需要导入模块: import HTMLTestRunner [as 别名]
# 或者: from HTMLTestRunner import HTMLTestRunner [as 别名]
def m3(test_output):
test_output_file = file(test_output, 'wb')
runner = HTMLTestRunner.HTMLTestRunner(
stream=test_output_file,
title='Device Pool Unit Test',
description='Device Pool Unit Test package',
verbosity=2)
runner.run(suite())