修改HTMLTestRunner适配Python3

HTMLTestRunner下载地址:http://tungwaiyip.info/software/HTMLTestRunner.html

修改方法:

1.将import StringIO修改成import io

2.将self.outputBuffer = StringIO.StringIO()修改成self.outputBuffer = io.StringIO()

3.将if not rmap.has_key(cls):修改成if not cls in rmap:

4.将uo = o.decode('latin-1')修改成uo = e

5.将ue = e.decode('latin-1')修改成ue = e

6.将print >> sys.stderr, ' Time Elapsed: %s' % (self.stopTime-self.startTime)修改成print(sys.stderr, ' Time Elapsed: %s' % (self.stopTime-self.startTime))

转载https://www.cnblogs.com/snailgirl/p/8521519.html

原文地址:https://www.cnblogs.com/1792353277lay/p/12145848.html