html报告中文显示乱码

时间:2021-08-25 18:12:15   收藏:0   阅读:25

用python + selenium,pytest框架,生成的html报告中,中文显示乱码,如下图:

技术分享图片

 

找到pytest-html 插件下的plugin.py(路径:/lib/python3.9/site-packages/pytest_html/plugin.py)做如下修改:

将  self.test_id = report.nodeid.encode("utf-8").decode("unicode_escape")

改为:self.test_id = report.nodeid

技术分享图片

 

 

 中文显示乱码的问题就解决了。

原文:https://www.cnblogs.com/dasiy520/p/15185182.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!