summaryrefslogtreecommitdiff
path: root/selftest/format-subunit
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-13 21:31:08 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-14 10:54:27 +0200
commit1626dc2bc95ef1c17221ba1a6404a72e21fcfc5b (patch)
treeabed13b4b36c0b97ea3d7a4bd35235e1c5f75a3f /selftest/format-subunit
parentfb1c96665201a8090bcf14db7a71a752e4cd7041 (diff)
downloadsamba-1626dc2bc95ef1c17221ba1a6404a72e21fcfc5b.tar.gz
samba-1626dc2bc95ef1c17221ba1a6404a72e21fcfc5b.tar.bz2
samba-1626dc2bc95ef1c17221ba1a6404a72e21fcfc5b.zip
subunit: Use subunit standard functions for handling time and progress.
Diffstat (limited to 'selftest/format-subunit')
-rwxr-xr-xselftest/format-subunit12
1 files changed, 6 insertions, 6 deletions
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