run文件中,pytest命令加上参数:--self-contained-html,就可解决此问题
pytest.main(["-v", "-s", "./test_case/", "--html=" + report,"--self-contained-html","--reruns",rerun])这样生成的报告中会加上css样式,发送到邮箱后,邮件也是带着样式的,如下图