HTMLTestRunner 生成测试报告文档

1、Unittests in 

     1、选择Edit Configurations......

     2、删除Unittestsxx所有测试

     3、

 

将py文件添加到python下。

添加方式 选中python,点击+号,选择python。在script path选择对应位置点击OK。即可运行HTMLTestRunner

  

1、AttributeError: type object '_io.StringIO' has no attribute 'StringIO'

 

2、AttributeError: 'dict' object has no attribute 'has_key'

 

3、 AttributeError: 'str' object has no attribute 'decode'

 

4、_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'

 

以上问题与python2和python3有关

第94行,将import StringIO修改成import io

第539行,将self.outputBuffer = StringIO.StringIO()修改成self.outputBuffer = io.StringIO()

第642行,将if not rmap.has_key(cls):修改成if not cls in rmap:

第766行,将uo = o.decode('latin-1')修改成uo = e

第775行,将ue = e.decode('latin-1')修改成ue = e

第631行,将print >> sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime)或者print(sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime))修改为sys.stderr.write('\nTime Elapsed: %s\n' % (self.stopTime - self.startTime))

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值