修改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, '\nTime Elapsed: %s' % (self.stopTime-self.startTime)修改成print(sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime))

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

posted on 2020-01-03 17:08  layxing1  阅读(187)  评论(0编辑  收藏  举报