Skip to content

Commit f251cea

Browse files
authored
Update plugin.py
Support Chinese display [before]: TestForSyncProduct::test_1_valueValid[test Case Name-add] TestForSyncProduct::test_2_valueValid[\u6d4b\u8bd5\u7528\u4f8b\u540d\u79f0-update] [now]: TestForSyncProduct::test_1_valueValid[test Case Name-add] TestForSyncProduct::test_2_valueValid[测试用例名称-update]
1 parent 0fa73c2 commit f251cea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_html/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def __init__(self, logfile, config):
103103

104104
class TestResult:
105105
def __init__(self, outcome, report, logfile, config):
106-
self.test_id = report.nodeid
106+
self.test_id = report.nodeid.encode("utf-8").decode("unicode_escape")
107107
if getattr(report, "when", "call") != "call":
108108
self.test_id = "::".join([report.nodeid, report.when])
109109
self.time = getattr(report, "duration", 0.0)

0 commit comments

Comments
 (0)