HtmlTestRunner
HtmlTestRunner copied to clipboard
The runner will report error if the testcase output include chinese random code
- HtmlTestRunner version: 1.2.1
- Python version:Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
- Operating System:
Description
I use the HtmlTESTRunner, it reports the follow error.
Becouse of my testcase is output the conent like "[{'Text': 'æ\x96°å\x91\x98å·¥å\x85¥è\x81\x8c', ...}]"
so I modify the code of HTMLTESTRunner/result.py in 404, as "with open(path_file, 'w', encoding='utf-8') as report_file:", its running is ok!
Is this line code need to modify?
Traceback (most recent call last):
File "D:/autotest/testProject/testcase/suite/suite_test01.py", line 26, in
What I Did
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
windows chinese read/write default gbk,unix always custom utf8. when read/write encoding is best practice