import imp
import optparse
import os
-from os.path import join, dirname, abspath, basename, isdir, exists
import platform
import re
import signal
import sys
import tempfile
import time
-import datetime
import threading
-from Queue import Queue, Empty
import utils
+from os.path import join, dirname, abspath, basename, isdir, exists
+from datetime import datetime
+from Queue import Queue, Empty
+
VERBOSE = False
self.AboutToRun(case)
self.lock.release()
try:
- start = datetime.datetime.now()
+ start = datetime.now()
output = case.Run()
- case.duration = (datetime.datetime.now() - start)
+ case.duration = (datetime.now() - start)
except IOError, e:
assert self.terminate
return
duration = output.test.duration
+ # total_seconds() was added in 2.7
+ total_seconds = (duration.microseconds +
+ (duration.seconds + duration.days * 24 * 3600) * 10**6) / 10**6
+
print ' ---'
- print ' duration_ms: %d.%d' % (duration.total_seconds(), duration.microseconds / 1000)
+ print ' duration_ms: %d.%d' % (total_seconds, duration.microseconds / 1000)
print ' ...'
def Done(self):