Open TimurNurlygayanov opened 6 years ago
Here is the workaround for the issue: need to hadcode version of the plugin in requirements.txt:
teamcity-messages==1.21
I've found the workaround!!!
Just add the following line into the beginning of all files with tests:
# -*- coding: utf-8 -*-
how it also can be fixed:
in file env/lib/python3.4/site-packages/teamcity/messages.py set utf8 by default:
class TeamcityServiceMessages(object):
def __init__(self, output=sys.stdout, now=datetime.datetime.now, encoding='utf-8'):
It is regression issue. Issue not reproduced on version 1.21, but reproduced with the latest version.
Steps To Reproduce: 1) Install latest version of teamcity-messages by pip 2) Run test with unicode symbols in test name (example - unicode parameter for PyTest test case will be included in test case name)
Expected Result: All works fine.
Actual Result: Tests failed with traceback:
[06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/pluggy/manager.py", line 61, in <lambda> [06:12:22]INTERNALERROR> firstresult=hook.spec_opts.get('firstresult'), [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/pluggy/callers.py", line 201, in _multicall [06:12:22]INTERNALERROR> return outcome.get_result() [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/pluggy/callers.py", line 76, in get_result [06:12:22]INTERNALERROR> raise ex[1].with_traceback(ex[2]) [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/pluggy/callers.py", line 180, in _multicall [06:12:22]INTERNALERROR> res = hook_impl.function(*args) [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/teamcity/pytest_plugin.py", line 205, in pytest_runtest_logreport [06:12:22]INTERNALERROR> self.report_test_output(report, test_id) [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/teamcity/pytest_plugin.py", line 153, in report_test_output [06:12:22]INTERNALERROR> self.teamcity.testStdOut(test_id, out=chunk, flowId=test_id) [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/teamcity/messages.py", line 131, in testStdOut [06:12:22]INTERNALERROR> self.message('testStdOut', name=testName, out=out, flowId=flowId) [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/teamcity/messages.py", line 68, in message [06:12:22]INTERNALERROR> self.output.write(self.encode(message)) [06:12:22]INTERNALERROR> File "/var/lib/buildagent/work/b174579a3751dcf0/env/lib/python3.4/site-packages/teamcity/messages.py", line 39, in encode [06:12:22]INTERNALERROR> value = value.encode(self.encoding) [06:12:22]INTERNALERROR> UnicodeEncodeError: 'ascii' codec can't encode characters in position 693-713: ordinal not in range(128) [06:12:22]Process exited with code 3