py.test --pep8 --junitxml=pep8.log
第一个控制台显示了pytest已经测试过的.py文件,然后显示一条消息:
INTERNALERROR> File "C:\Python27\lib\site-packages\_pytest\junitxml.py", line 134, in append_failure
INTERNALERROR> fail.append(str(report.longrepr))
INTERNALERROR> UnicodeEncodeError: 'ascii' codec can't encode characters in position 1430-1434: ordinal not in range(128)
我试图通过将fail.append(str(report.longrepr))
转换为fail.append(str(report.longrepr.encode("utf-8")))
来解决这个问题,但是pytest在这个文件的其他行继续失败,并且_XML生成.py文件。在
我认为有一个更好的方法来全局解决这个问题,然后编辑它失败的每一行代码。在
我为pytest developer提交了一个问题,它被修复了https://bitbucket.org/hpk42/pytest/issue/368/unicode-error-when-launching-pytest
相关问题 更多 >
编程相关推荐