From 050f617ac16d01e5d6258fdbab6df6d116f1b00c Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Tue, 21 Feb 2017 00:04:07 +0300 Subject: [PATCH] Support non-test messages from runners * Messages like "buildStatisticValue" could be generated by runner * We must skip them --- python/helpers/pycharm/_jb_runner_tools.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/helpers/pycharm/_jb_runner_tools.py b/python/helpers/pycharm/_jb_runner_tools.py index 8f74f51c8814..3a9746c98aea 100644 --- a/python/helpers/pycharm/_jb_runner_tools.py +++ b/python/helpers/pycharm/_jb_runner_tools.py @@ -162,7 +162,14 @@ class NewTeamcityServiceMessages(_old_service_messages): if messageName in {"enteredTheMatrix", "testCount"}: _old_service_messages.message(self, messageName, **properties) return - properties["locationHint"] = "python://{0}".format(properties["name"]) + + try: + properties["locationHint"] = "python://{0}".format(properties["name"]) + except KeyError: + # If message does not have name, then it is not test + # Simply pass it + _old_service_messages.message(self, messageName, **properties) + return # Shortcut for name try: @@ -227,7 +234,7 @@ class NewTeamcityServiceMessages(_old_service_messages): def testFailed(self, testName, message='', details='', flowId=None): testName = ".".join(self._test_to_list(testName)) args = {"name": testName, "message": str(message), - "details": details} + "details": details} self.message("testFailed", **args) def testFinished(self, testName, testDuration=None, flowId=None, is_suite=False):