unittest 测试报告
作者:互联网
HTMLRUNNER 测试报告
下载地址:http://tungwaiyip.info/software/HTMLTestRunner.html
打开页面直接另存为就好
注意:由于是基于Python2写出的脚本,所以很多地方需要修改
- import StringIO ==> from io import StringIO
- self.outputBuffer = StringIO.StringIO() ==> self.outputBuffer = StringIO()
- TestResult.init(self) ==> super(_TestResult, self).init(verbosity)
- print >> sys.stderr, '\nTime Elapsed: %s' % (self.stopTime - self.startTime) ==> print(">> ", sys.stderr, '\nTime Elapsed: %s' % (self.stopTime - self.startTime))
- if not rmap.has_key(cls): ==> if cls not in rmap.keys():
- self.stream.write(output.encode('utf8')) ==> self.stream.write(output)
- uo = o.decode('latin-1') ==> uo = o.encode().decode("utf-8")
- ue = e.decode('latin-1') ==> ue = e.encode().decode("utf-8")
由于源码太长不便附上
BeautifulReport
标签:测试报告,stream,StringIO,unittest,decode,encode,self,TestResult 来源: https://www.cnblogs.com/kxtomato/p/16444900.html