diff --git a/python/helpers/pycharm/teamcity/__init__.py b/python/helpers/pycharm/teamcity/__init__.py index 7db1cf0212a2..fbb111bc2f13 100644 --- a/python/helpers/pycharm/teamcity/__init__.py +++ b/python/helpers/pycharm/teamcity/__init__.py @@ -3,7 +3,7 @@ import os __all__ = ['is_running_under_teamcity'] -__version__ = "1.29" +__version__ = "1.33" teamcity_presence_env_var = "TEAMCITY_VERSION" diff --git a/python/helpers/pycharm/teamcity/messages.py b/python/helpers/pycharm/teamcity/messages.py index 678ad5fe1eef..cbbf8d150e25 100644 --- a/python/helpers/pycharm/teamcity/messages.py +++ b/python/helpers/pycharm/teamcity/messages.py @@ -65,7 +65,7 @@ class TeamcityServiceMessages(object): def encode(self, value): if self.encoding and isinstance(value, text_type): - value = value.encode(self.encoding) + value = value.encode(self.encoding, errors='backslashreplace') return value def decode(self, value): diff --git a/python/helpers/pycharm/teamcity/pylint_reporter.py b/python/helpers/pycharm/teamcity/pylint_reporter.py index f25dec63382a..ef1b4d1a2dbd 100644 --- a/python/helpers/pycharm/teamcity/pylint_reporter.py +++ b/python/helpers/pycharm/teamcity/pylint_reporter.py @@ -84,7 +84,12 @@ class TeamCityReporter(reporters.BaseReporter): def display_reports(self, layout): """Issues the final PyLint score as a TeamCity build statistic value""" try: - score = self.linter.stats['global_note'] + stats = self.linter.stats + score = getattr(stats, 'global_note', None) + + # Backwards compatibility for pylint version <2.12 + if score is None: + score = stats['global_note'] except (AttributeError, KeyError): pass else: diff --git a/python/helpers/pycharm/teamcity/pytest_plugin.py b/python/helpers/pycharm/teamcity/pytest_plugin.py index fe58a8836ef2..549bf5037d31 100644 --- a/python/helpers/pycharm/teamcity/pytest_plugin.py +++ b/python/helpers/pycharm/teamcity/pytest_plugin.py @@ -392,7 +392,7 @@ class EchoTeamCityMessages(object): for cu in units: try: - analysis = self.coverage._analyze(cu) + analysis = self.coverage._analyze(cu.filename) nums = analysis.numbers total += nums except KeyboardInterrupt: @@ -406,7 +406,7 @@ class EchoTeamCityMessages(object): if typ is NotPython and not cu.should_be_python(): continue - test_id = cu.name + test_id = cu.relname details = convert_error_to_string(err) self.messages.testStarted(test_id, flowId=test_id)