PY-19907: check `startTime` property type. If it has wrong type, that means user has custom property. Fail and report this fact.

This commit is contained in:
Ilya.Kazakevich
2016-06-23 17:52:46 +03:00
parent 05882b5728
commit 9a5e20cca0
+2
View File
@@ -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