两种解决方法:
1、创建个pytest.ini 文件
[pytest]
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True
2、在用例目录创建 config.py 文件,写入
def pytest_collection_modifyitems(items):
for item in items:
item.name = item.name.encode("utf-8").decode("unicode_escape")
item._nodeid = item.nodeid.encode("utf-8").decode("unicode_escape")