diff options
| author | Robert Collins <robertc@robertcollins.net> | 2009-07-20 20:08:11 +1000 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2009-07-20 20:08:11 +1000 |
| commit | e617f7cb78e375ecd3bb0df18633a3a5f05e1d02 (patch) | |
| tree | 1ee2158e0d74a35b4a7390c7024dcea086982791 /python/subunit/__init__.py | |
| parent | 83e2424fbb77ca1ea6cf4b3fefddd10616b4e95c (diff) | |
| download | subunit-git-e617f7cb78e375ecd3bb0df18633a3a5f05e1d02.tar.gz | |
Support microsecond times.
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 11 |
1 files changed, 6 insertions, 5 deletions
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.""" |
