I have a problem with displaying test names with russian text in file paths in pytest-3.0.5. When I run on pytest==2.9.2 - everything is OK:
py.test -s -q --collect-only
Output:
test_card.py::test_graphic_card[/root/test_cases/files/Кредитная_карта_мир_41.png]
But when I try to run the same command on pytest==3.0.5:
py.test -s -q --collect-only
Output:
test_card.py::test_graphic_card[/root/test_cases/files/\xd0\x9a\xd1\x80\xd0\xb5\xd0\xb4\xd0\xb8\xd1\x82\xd0\xbd\xd0\xb0\xd1\x8f_\xd0\xba\xd0\xb0\xd1\x80\xd1\x82\xd0\xb0_\xd0\xbc\xd0\xb8\xd1\x80_41.png]
What should I do to have py.test==3.0.5 display test names like displayed py.test==2.9.2?
I looked at the pytest source code and found out, that in newest version of pytest when tests are collected, they are processed with recently added function "_escape_strings". In this function:
I suppose this func is self-explained. Finally, I've solved my problem decoding and unescaping of results in final test report, e.g.: