pytest 3.9在python 2.7下的一个bug

最在在使用pytest,用的是pytest 3.9.3,python版本为2.7.10,但一直在使用时发现总提示

File "c:\python27\Lib\json\__init__.py", line 189, in dump
    for chunk in iterable:
  File "c:\python27\Lib\json\encoder.py", line 431, in _iterencode
    for chunk in _iterencode_list(o, _current_indent_level):
  File "c:\python27\Lib\json\encoder.py", line 313, in _iterencode_list
    yield buf + _encoder(value)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb7 in position 2: invalid start byte

 

在反复查看后,原来我的项目路径中存在中文字符,有两种解决方法

1、将pytest降版本,降至3.1.2

2、将项目路径改成全英文

 

随后将该问题提示github并确认为bug

 https://github.com/pytest-dev/pytest/issues/4290

posted @ 2018-11-05 10:19  Believer007  阅读(322)  评论(0编辑  收藏  举报