From e617f7cb78e375ecd3bb0df18633a3a5f05e1d02 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Mon, 20 Jul 2009 20:08:11 +1000 Subject: Support microsecond times. --- python/subunit/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'python/subunit/__init__.py') diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 1a20dab..72d5b2d 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -17,15 +17,17 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -import calendar +import datetime import os import re from StringIO import StringIO import subprocess import sys -import time import unittest +import iso8601 + + def test_suite(): import subunit.tests return subunit.tests.test_suite() @@ -211,11 +213,10 @@ class TestProtocolServer(object): def _handleTime(self, offset, line): # Accept it, but do not do anything with it yet. - event_time = time.strptime(line[offset:-1], "%Y-%m-%d %H:%M:%SZ") - time_seconds = calendar.timegm(event_time) + event_time = iso8601.parse_date(line[offset:-1]) time_method = getattr(self.client, 'time', None) if callable(time_method): - time_method(time_seconds) + time_method(event_time) def lineReceived(self, line): """Call the appropriate local method for the received line.""" -- cgit v1.2.1