前言使用ddt框架生成html报告的时候出现dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> 遇到问题使用ddt框架生成html报告的时候,出现:dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> 解决办法使用pip show查看ddt版本号Version: 1.2.0
Name: ddt
Version: 1.2.0
Summary: Data-Driven/Decorated Tests
Home-page: https://github.com/txels/ddt
Author: Carles Barrobés
Author-email: carles@barrobes.com
License: UNKNOWN
Location: d:\soft\python3.6\lib\site-packages
Requires:
Required-by: 先使用pip uninstall ddt载了,再重新一点的ddt版本就好了,指定版本号用两个等号,后面接对应版本号即可
接下来重新运行代码,生成的报告就可以正常的展示出中文的内容了 对比源码Version: 1.1.2源码 Version: 1.2.0源码 通过对比2个版本的源码,发现里面少一行代码:testdocstring = getattr(v, “_doc“, None) |
|