python3 中引用 HTMLTestRunner.py 模块的注意事项

HTMLTestRunner.py支持python2中运行,如果在python3.6.2中引用HTMLTestRunner.py模块,需要做一下更改

1、更改HTMLTestRunner.py模块中的代码    

1、更改StringIO模块导入方式: 

 2、self.outputBuffer=StringIO.StringIO()  改为self.outputBuffer= StringIO()

 

 3、python3.6.2字典无has_key方法:

 

    4、str没有decode方法,去掉decode转码方法

     5、python3中print方法无>>

2、调用方式:

1、引用时注意文件写入方式

2、运行run-run-运行的py文件


posted on 2018-03-07 11:52  蜗牛也是妞  阅读(6500)  评论(0编辑  收藏  举报