fix(report): use utf-8-sig encoding for Chinese report to display correctly in browsers
The Chinese report now correctly shows: 司机APP接单到管理端核算打款完整流程 [通过] (96.8s)
This commit is contained in:
+2
-2
@@ -118,7 +118,7 @@ def pytest_sessionfinish(session):
|
|||||||
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
html = _build_cn_report_html(total, passed, failed, skipped, pass_rate, cases, now)
|
html = _build_cn_report_html(total, passed, failed, skipped, pass_rate, cases, now)
|
||||||
(report_dir / "report_cn.html").write_text(html, encoding="utf-8")
|
(report_dir / "report_cn.html").write_text(html, encoding="utf-8-sig")
|
||||||
|
|
||||||
|
|
||||||
def _resolve_cn_name(session, func_name: str) -> str:
|
def _resolve_cn_name(session, func_name: str) -> str:
|
||||||
@@ -154,7 +154,7 @@ def _resolve_cn_name(session, func_name: str) -> str:
|
|||||||
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
|
||||||
html = _build_cn_report_html(total, passed, failed, skipped, pass_rate, cases, now)
|
html = _build_cn_report_html(total, passed, failed, skipped, pass_rate, cases, now)
|
||||||
(report_dir / "report_cn.html").write_text(html, encoding="utf-8")
|
(report_dir / "report_cn.html").write_text(html, encoding="utf-8-sig")
|
||||||
|
|
||||||
|
|
||||||
def _build_cn_report_html(total, passed, failed, skipped, rate, cases, now):
|
def _build_cn_report_html(total, passed, failed, skipped, rate, cases, now):
|
||||||
|
|||||||
Reference in New Issue
Block a user