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)

posted @ 2022-10-10 20:45  赏金猎人小熊  阅读(230)  评论(0编辑  收藏  举报