现象:
采用如下方式可将其正确显示为中文
ss = r"test_fix.py::Test1::test_s1[\u6d4b\u8bd5-\u6d4b\u8bd5]" print(ss.encode("utf-8").decode("unicode_escape")) 输出结果: test_fix.py::Test1::test_s1[测试-测试]
附:unicode与utf8的关系:https://www.cnblogs.com/liudi2017/articles/9418465.html