From 9a5e20cca0f79ef2e5fbe4c3132bf9cbb04736de Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Thu, 23 Jun 2016 17:51:52 +0300 Subject: [PATCH] PY-19907: check ``startTime`` property type. If it has wrong type, that means user has custom property. Fail and report this fact. --- python/helpers/pycharm/tcunittest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/helpers/pycharm/tcunittest.py b/python/helpers/pycharm/tcunittest.py index 185c12898a1e..1418bfa487ed 100644 --- a/python/helpers/pycharm/tcunittest.py +++ b/python/helpers/pycharm/tcunittest.py @@ -211,6 +211,8 @@ class TeamcityTestResult(TestResult): def __getDuration(self, test): start = getattr(test, "startTime", datetime.datetime.now()) + assert isinstance(start, datetime.datetime), \ + "You testcase has property named 'startTime' (value {0}). Please, rename it".format(start) d = datetime.datetime.now() - start duration = d.microseconds / 1000 + d.seconds * 1000 + d.days * 86400000 return duration