diff options
Diffstat (limited to 'xtesting/core')
-rw-r--r-- | xtesting/core/testcase.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py index c4dec22f..8faf3f43 100644 --- a/xtesting/core/testcase.py +++ b/xtesting/core/testcase.py @@ -107,8 +107,9 @@ class TestCase(): assert self.stop_time if self.stop_time < self.start_time: return "XX:XX" - return "{0[0]:02.0f}:{0[1]:02.0f}".format(divmod( - self.stop_time - self.start_time, 60)) + return "{}:{}".format( + str(int(self.stop_time - self.start_time) // 60).zfill(2), + str(int(self.stop_time - self.start_time) % 60).zfill(2)) except Exception: # pylint: disable=broad-except self.__logger.error("Please run test before getting the duration") return "XX:XX" |