Merge branch 'py-15166' of https://github.com/happy-monk/intellij-community
authorIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Mon, 17 Oct 2016 20:04:18 +0000 (23:04 +0300)
committerIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Mon, 17 Oct 2016 20:04:18 +0000 (23:04 +0300)
1  2 
python/helpers/pycharm/tcunittest.py

index 1418bfa487edee8d8cc845a47f88e70854072864,36a0220b5687be96c8f3890d379612be21e1bb0c..f3b56a914ceee195cf61c329e3a47683c1451c62
@@@ -209,15 -204,9 +209,16 @@@ class TeamcityTestResult(TestResult)
        self.messages.testSuiteFinished(self.subtest_suite)
        self.subtest_suite = None
  
 +  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
  
    def addSubTest(self, test, subtest, err):
+     location = self.init_suite(test)
      suite_name = self.getTestName(test)  # + " (subTests)"
      if not self.subtest_suite:
        self.subtest_suite = suite_name