• Python 3.6版本中实现 HTMLTestRunner输出时”fp=file(filename,'wb')“报错


    原错误代码:

    if __name__=='__main__': suite=unittest.makeSuite(WidgetTestCase) filename='D:\myreport.html' fp=file(filename,'wb') runner=HTMLTestRunner.HTMLTestRunner(fp,title=u'my unit test',description=u'This is a report test') runner.run(suite)

    改成以下格式就正常了:
    if __name__ == '__main__':
    filename = './myAppiumLog.html'
    with open(filename, 'wb') as f:
    # 使用HTMLTestRunner配置参数,输出报告路径、报告标题、描述
    runner = HTMLTestRunner.HTMLTestRunner(
    stream=f,
    title='Report_title',
    description='Report_description'
    )
  • 相关阅读:
    配置步骤
    swap区
    Oracle的left join中on和where的区别
    drop与truncate
    关于trace
    oracle执行计划连接方式
    oracle系统结构
    查询存档
    oracle统计信息
    分区索引
  • 原文地址:https://www.cnblogs.com/youqingyan/p/9347069.html
Copyright © 2020-2023  润新知