UI自动化测试---unittest2生成测试报告报错AttributeError: 'str' object has no attribute 'write'

错误信息:
runner.run(suite1)
AttributeError: ‘str’ object has no attribute ‘write’

报错:
UI自动化测试---unittest2生成测试报告报错AttributeError: 'str' object has no attribute 'write'原代码:
UI自动化测试---unittest2生成测试报告报错AttributeError: 'str' object has no attribute 'write'

修改后:
没有打开文件,怎么写!!!!!
UI自动化测试---unittest2生成测试报告报错AttributeError: 'str' object has no attribute 'write'