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

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

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

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

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

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

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

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

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

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

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

     5、python3中print方法无>>

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

2、调用方式:

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

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

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

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

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


 
                    
            
                

相关文章: