summaryrefslogtreecommitdiff
path: root/python/subunit/tests
diff options
context:
space:
mode:
Diffstat (limited to 'python/subunit/tests')
-rw-r--r--python/subunit/tests/test_output_filter.py3
-rw-r--r--python/subunit/tests/test_subunit_filter.py5
-rw-r--r--python/subunit/tests/test_test_protocol.py7
-rw-r--r--python/subunit/tests/test_test_protocol2.py6
-rw-r--r--python/subunit/tests/test_test_results.py6
5 files changed, 15 insertions, 12 deletions
diff --git a/python/subunit/tests/test_output_filter.py b/python/subunit/tests/test_output_filter.py
index 0501f79..555d70a 100644
--- a/python/subunit/tests/test_output_filter.py
+++ b/python/subunit/tests/test_output_filter.py
@@ -22,6 +22,8 @@ from functools import partial
from io import BytesIO, StringIO, TextIOWrapper
from tempfile import NamedTemporaryFile
+from iso8601 import UTC
+
from testtools import TestCase
from testtools.compat import _u
from testtools.matchers import (Equals, Matcher, MatchesAny, MatchesListwise,
@@ -31,7 +33,6 @@ from testtools.testresult.doubles import StreamResult
import subunit._output as _o
from subunit._output import (_ALL_ACTIONS, _FINAL_ACTIONS,
generate_stream_results, parse_arguments)
-from subunit.iso8601 import UTC
from subunit.v2 import ByteStreamToStreamResult, StreamResultToBytes
diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py
index a3baa5c..508a5df 100644
--- a/python/subunit/tests/test_subunit_filter.py
+++ b/python/subunit/tests/test_subunit_filter.py
@@ -27,9 +27,10 @@ from testtools import TestCase
from testtools.compat import _b
from testtools.testresult.doubles import ExtendedTestResult, StreamResult
+import iso8601
import subunit
-from subunit import ByteStreamToStreamResult, StreamResultToBytes, iso8601
-from subunit.test_results import TestResultFilter, make_tag_filter
+from subunit.test_results import make_tag_filter, TestResultFilter
+from subunit import ByteStreamToStreamResult, StreamResultToBytes
class TestTestResultFilter(TestCase):
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index a40591e..7ad28d2 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -39,8 +39,9 @@ except ImportError:
from testtools.matchers import Contains, Equals, MatchesAny
+import iso8601
+
import subunit
-import subunit.iso8601 as iso8601
from subunit.tests import (_remote_exception_repr,
_remote_exception_repr_chunked,
_remote_exception_str,
@@ -981,7 +982,7 @@ class TestTestProtocolServerStreamTime(unittest.TestCase):
self.assertEqual(_b(""), self.stream.getvalue())
self.assertEqual([
('time', datetime.datetime(2001, 12, 12, 12, 59, 59, 0,
- iso8601.Utc()))
+ iso8601.UTC))
], self.result._events)
@@ -1386,7 +1387,7 @@ class TestTestProtocolClient(TestCase):
def test_time(self):
# Calling time() outputs a time signal immediately.
self.protocol.time(
- datetime.datetime(2009,10,11,12,13,14,15, iso8601.Utc()))
+ datetime.datetime(2009,10,11,12,13,14,15, iso8601.UTC))
self.assertEqual(
_b("time: 2009-10-11 12:13:14.000015Z\n"),
self.io.getvalue())
diff --git a/python/subunit/tests/test_test_protocol2.py b/python/subunit/tests/test_test_protocol2.py
index 4f0eb9f..ef88092 100644
--- a/python/subunit/tests/test_test_protocol2.py
+++ b/python/subunit/tests/test_test_protocol2.py
@@ -32,7 +32,7 @@ from testtools.testresult.doubles import StreamResult
from testtools.tests.test_testresult import TestStreamResultContract
import subunit
-import subunit.iso8601 as iso8601
+import iso8601
CONSTANT_ENUM = b'\xb3)\x01\x0c\x03foo\x08U_\x1b'
CONSTANT_INPROGRESS = b'\xb3)\x02\x0c\x03foo\x8e\xc1-\xb5'
@@ -218,7 +218,7 @@ class TestStreamResultToBytes(TestCase):
def test_timestamp(self):
timestamp = datetime.datetime(2001, 12, 12, 12, 59, 59, 45,
- iso8601.Utc())
+ iso8601.UTC)
result, output = self._make_result()
result.status(test_id="bar", test_status='success', timestamp=timestamp)
self.assertEqual(CONSTANT_TIMESTAMP, output.getvalue())
@@ -382,7 +382,7 @@ class TestByteStreamToStreamResult(TestCase):
def test_timestamp(self):
timestamp = datetime.datetime(2001, 12, 12, 12, 59, 59, 45,
- iso8601.Utc())
+ iso8601.UTC)
self.check_event(CONSTANT_TIMESTAMP,
'success', test_id='bar', timestamp=timestamp)
diff --git a/python/subunit/tests/test_test_results.py b/python/subunit/tests/test_test_results.py
index 765454a..fc14133 100644
--- a/python/subunit/tests/test_test_results.py
+++ b/python/subunit/tests/test_test_results.py
@@ -26,7 +26,7 @@ from testtools.content import TracebackContent, text_content
from testtools.testresult.doubles import ExtendedTestResult
import subunit
-import subunit.iso8601 as iso8601
+import iso8601
import subunit.test_results
@@ -174,7 +174,7 @@ class TestAutoTimingTestResultDecorator(unittest.TestCase):
def test_calling_time_inhibits_automatic_time(self):
# Calling time() outputs a time signal immediately and prevents
# automatically adding one when other methods are called.
- time = datetime.datetime(2009,10,11,12,13,14,15, iso8601.Utc())
+ time = datetime.datetime(2009,10,11,12,13,14,15, iso8601.UTC)
self.result.time(time)
self.result.startTest(self)
self.result.stopTest(self)
@@ -182,7 +182,7 @@ class TestAutoTimingTestResultDecorator(unittest.TestCase):
self.assertEqual(time, self.decorated._calls[0])
def test_calling_time_None_enables_automatic_time(self):
- time = datetime.datetime(2009,10,11,12,13,14,15, iso8601.Utc())
+ time = datetime.datetime(2009,10,11,12,13,14,15, iso8601.UTC)
self.result.time(time)
self.assertEqual(1, len(self.decorated._calls))
self.assertEqual(time, self.decorated._calls[0])