python输出测试报告时,报AttributeError: ‘_TestResult‘ object has no attribute ‘outputBuffer‘
1.报错信息:
1.报错信息:
AttributeError: '_TestResult' object has no attribute 'outputBuffer'
2.解决方案:
找到HTMLTestRunner.py模块的源码,在构造器'init()'中添加如下代码:
self.outputBuffer = io.StringIO()
self.test_start_time = round(time.time(), 2)