HTMLTestRunner修改成Python3版本

 

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

    BSTestRunner     下载地址:https://github.com/easonhan007/HTMLTestRunner

 

修改后:HTMLTestRunner下载地址:https://pan.baidu.com/s/1W6e_Bqg9dZTkVOWUP93XkA

    BSTestRunner     下载地址:https://pan.baidu.com/s/1nuJLWYdbq5ur8qoOSUq-8A

修改方法:

第94行,将import StringIO修改成import io

第539行,将self.outputBuffer = StringIO.StringIO()修改成self.outputBuffer = io.StringIO()

第642行,将if not rmap.has_key(cls):修改成if not cls in rmap:

第766行,将uo = o.decode('latin-1')修改成uo = e

第775行,将ue = e.decode('latin-1')修改成ue = e

第631行,将print >> sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime)修改成print(sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime))

 

测试结果:

HTMLTestRunner

 

 BSTestRunner

posted @ 2019-03-14 18:23  一抹浅笑  阅读(384)  评论(1编辑  收藏  举报