From 1626dc2bc95ef1c17221ba1a6404a72e21fcfc5b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 13 Sep 2010 21:31:08 +0200 Subject: subunit: Use subunit standard functions for handling time and progress. --- selftest/format-subunit | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'selftest/format-subunit') diff --git a/selftest/format-subunit b/selftest/format-subunit index ff57b54ace..25cc206fef 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -14,10 +14,10 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/testtools")) import subunithelper import subunit -import testtools -def format_time(t): - minutes, seconds = divmod(t, 60) + +def format_time(delta): + minutes, seconds = divmod(delta.seconds, 60) hours, minutes = divmod(minutes, 60) ret = "" if hours: @@ -57,10 +57,10 @@ class PlainFormatter(subunithelper.TestsuiteEnabledTestResult): elif whence == subunit.PROGRESS_CUR: raise NotImplementedError - def report_time(self, time): + def time(self, dt): if self.start_time is None: - self.start_time = time - self.last_time = time + self.start_time = dt + self.last_time = dt def start_testsuite(self, name): self.index += 1 -- cgit