赞
踩
自动化测试报告必备第三方库
- > pip install HTMLTestRunner
- Defaulting to user installation because normal site-packages is not writeable
- ERROR: Could not find a version that satisfies the requirement HTMLTestRunner (from versions: none)
- ERROR: No matching distribution found for HTMLTestRunner
HTMLTestRunner第三方库是由Python2编写的,目前没有版本更新。
下载 “HTMLTestRunner.py (0.8.2)” ,将其放入Python安装路径的Lib目录下。
并修改HTMLTestRunner.py内容(将部分Python2的语法改为Python3语法)。
- 094行:import StringIO 改为 import io
-
- 539行:self.outputBuffer = StringIO.StringIO() 改成 self.outputBuffer = io.StringIO()
-
- 631行:print >> sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime)
- 631改:print(sys.stderr, '\nTime Elapsed: %s' % (self.stopTime-self.startTime))
-
- 642行:if not rmap.has_key(cls): 改成 if not cls in rmap:
-
- 766行:uo = o.decode('latin-1') 改成 uo = e
-
- 772行:ue = e.decode('latin-1') 改成 ue = e
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。