版本:pytest-html 3.2.0
代码如下:
在终端执行 pytest cases --html=report.html --self-contained-html 后,
终端上显示报错信息为”UnicodeEncodeError: ‘gbk’ codec can’t encode character ‘\xe7’ in position 13974: illegal multibyte sequence“。
根据网上资料,在python安装目录下的 lib\site-packages\pytest_html\result.py 中找到下述代码【注:3.2.0之前的旧版本是在plugin.py文件里】:
class TestResult:
def __init__(self, outcome, report, logfile, config