1.在自己的测试脚本中加入下面的代码并保存:
  1. # -.- coding:utf-8 -.-
  2. import sys
  3. reload(sys)
  4. sys.setdefaultencoding('utf-8')
2.打开HTMLTestRunner.py,修改其中的第777行和第783行,将其中的编码“latin-1”修改为“utf-8”后保存,具体如下所示:
  1. if isinstance(o,str):
  2. # TODO: some problem with 'string_escape': it escape \n and mess up formating
  3. # uo = unicode(o.encode('string_escape'))
  4. uo = o.decode('utf-8')
  5. else:
  6. uo = o
  7. if isinstance(e,str):
  8. # TODO: some problem with 'string_escape': it escape \n and mess up formating
  9. # ue = unicode(e.encode('string_escape'))
  10. ue = e.decode('utf-8')
  11. else:
  12. ue = e

相关文章:

  • 2021-10-24
  • 2021-11-06
  • 2021-12-25
  • 2022-02-16
  • 2021-09-25
  • 2021-07-14
  • 2021-04-19
  • 2022-12-23
猜你喜欢
  • 2021-09-28
  • 2022-01-14
  • 2021-11-06
  • 2022-01-11
相关资源
相似解决方案