summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/subunit/NEWS37
-rw-r--r--lib/subunit/configure.ac2
-rwxr-xr-xlib/subunit/python/subunit/run.py2
-rw-r--r--lib/subunit/python/subunit/tests/__init__.py2
-rw-r--r--lib/subunit/python/subunit/tests/test_run.py52
-rw-r--r--lib/subunit/python/subunit/tests/test_test_protocol.py17
-rwxr-xr-xlib/subunit/setup.py2
7 files changed, 92 insertions, 22 deletions
diff --git a/lib/subunit/NEWS b/lib/subunit/NEWS
index 2edf7369d9b..713d272bfaa 100644
--- a/lib/subunit/NEWS
+++ b/lib/subunit/NEWS
@@ -5,6 +5,26 @@ subunit release notes
NEXT (In development)
---------------------
+IMPROVEMENTS
+~~~~~~~~~~~~
+
+* Perl module now correctly outputs "failure" instead of "fail". (Stewart Smith)
+
+* Shell functions now output timestamps. (Stewart Smith)
+
+BUG FIXES
+~~~~~~~~~
+
+* Add 'subunit --no-xfail', which will omit expected failures from the subunit
+ stream. (John Arbash Meinel, #623642)
+
+* Add 'subunit -F/--only-genuine-failures' which sets all of '--no-skips',
+ '--no-xfail', '--no-passthrough, '--no-success', and gives you just the
+ failure stream. (John Arbash Meinel)
+
+0.0.7
+-----
+
The Subunit Python test runner ``python -m subunit.run`` can now report the
test ids and also filter via a test id list file thanks to improvements in
``testtools.run``. See the testtools manual, or testrepository - a major
@@ -26,13 +46,9 @@ IMPROVEMENTS
* Force flush of writes to stdout in c/tests/test_child.
(Jelmer Vernooij, #687611)
-* Perl module now correctly outputs "failure" instead of "fail". (Stewart Smith)
-
* Provisional Python 3.x support.
(Robert Collins, Tres Seaver, Martin[gz], #666819)
-* Shell functions now output timestamps. (Stewart Smith)
-
* ``subunit.chunked.Decoder`` Python class takes a new ``strict`` option,
which defaults to ``True``. When ``False``, the ``Decoder`` will accept
incorrect input that is still unambiguous. i.e. subunit will not barf if
@@ -68,20 +84,11 @@ IMPROVEMENTS
* The Python2.7 / testtools addUnexpectedSuccess API is now supported. This
required adding a new status code to the protocol. (Robert Collins, #654474)
-BUG FIXES
-~~~~~~~~~
-
-* Add 'subunit --no-xfail', which will omit expected failures from the subunit
- stream. (John Arbash Meinel, #623642)
-
-* Add 'subunit -F/--only-genuine-failures' which sets all of '--no-skips',
- '--no-xfail', '--no-passthrough, '--no-success', and gives you just the
- failure stream. (John Arbash Meinel)
-
CHANGES
~~~~~~~
-* Newer testtools is needed as part of the Python 3 support. (Robert Collins)
+* testtools 0.9.11 or newer is new needed (due to the Python 3 support).
+ (Robert Collins)
0.0.6
-----
diff --git a/lib/subunit/configure.ac b/lib/subunit/configure.ac
index 56965734642..4375c379a3c 100644
--- a/lib/subunit/configure.ac
+++ b/lib/subunit/configure.ac
@@ -1,6 +1,6 @@
m4_define([SUBUNIT_MAJOR_VERSION], [0])
m4_define([SUBUNIT_MINOR_VERSION], [0])
-m4_define([SUBUNIT_MICRO_VERSION], [6])
+m4_define([SUBUNIT_MICRO_VERSION], [7])
m4_define([SUBUNIT_VERSION],
m4_defn([SUBUNIT_MAJOR_VERSION]).m4_defn([SUBUNIT_MINOR_VERSION]).m4_defn([SUBUNIT_MICRO_VERSION]))
AC_PREREQ([2.59])
diff --git a/lib/subunit/python/subunit/run.py b/lib/subunit/python/subunit/run.py
index 51d6837aab7..ca5fe5c17e0 100755
--- a/lib/subunit/python/subunit/run.py
+++ b/lib/subunit/python/subunit/run.py
@@ -23,6 +23,7 @@
import sys
from subunit import TestProtocolClient, get_default_formatter
+from subunit.test_results import AutoTimingTestResultDecorator
from testtools.run import (
BUFFEROUTPUT,
CATCHBREAK,
@@ -39,6 +40,7 @@ class SubunitTestRunner(object):
def run(self, test):
"Run the given test case or test suite."
result = TestProtocolClient(self.stream)
+ result = AutoTimingTestResultDecorator(result)
test(result)
return result
diff --git a/lib/subunit/python/subunit/tests/__init__.py b/lib/subunit/python/subunit/tests/__init__.py
index a78cec85722..e0e1eb1b040 100644
--- a/lib/subunit/python/subunit/tests/__init__.py
+++ b/lib/subunit/python/subunit/tests/__init__.py
@@ -19,6 +19,7 @@ from subunit.tests import (
test_chunked,
test_details,
test_progress_model,
+ test_run,
test_subunit_filter,
test_subunit_stats,
test_subunit_tags,
@@ -38,4 +39,5 @@ def test_suite():
result.addTest(test_subunit_filter.test_suite())
result.addTest(test_subunit_tags.test_suite())
result.addTest(test_subunit_stats.test_suite())
+ result.addTest(test_run.test_suite())
return result
diff --git a/lib/subunit/python/subunit/tests/test_run.py b/lib/subunit/python/subunit/tests/test_run.py
new file mode 100644
index 00000000000..5a96bcf30e7
--- /dev/null
+++ b/lib/subunit/python/subunit/tests/test_run.py
@@ -0,0 +1,52 @@
+#
+# subunit: extensions to python unittest to get test results from subprocesses.
+# Copyright (C) 2011 Robert Collins <robertc@robertcollins.net>
+#
+# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
+# license at the users choice. A copy of both licenses are available in the
+# project source as Apache-2.0 and BSD. You may not use this file except in
+# compliance with one of these two licences.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# license you chose for the specific language governing permissions and
+# limitations under that license.
+#
+
+from cStringIO import StringIO
+import unittest
+
+from testtools import PlaceHolder
+
+import subunit
+from subunit.run import SubunitTestRunner
+
+
+def test_suite():
+ loader = subunit.tests.TestUtil.TestLoader()
+ result = loader.loadTestsFromName(__name__)
+ return result
+
+
+class TimeCollectingTestResult(unittest.TestResult):
+
+ def __init__(self, *args, **kwargs):
+ super(TimeCollectingTestResult, self).__init__(*args, **kwargs)
+ self.time_called = []
+
+ def time(self, a_time):
+ self.time_called.append(a_time)
+
+
+class TestSubunitTestRunner(unittest.TestCase):
+
+ def test_includes_timing_output(self):
+ io = StringIO()
+ runner = SubunitTestRunner(stream=io)
+ test = PlaceHolder('name')
+ runner.run(test)
+ client = TimeCollectingTestResult()
+ io.seek(0)
+ subunit.TestProtocolServer(client).readFrom(io)
+ self.assertTrue(len(client.time_called) > 0)
diff --git a/lib/subunit/python/subunit/tests/test_test_protocol.py b/lib/subunit/python/subunit/tests/test_test_protocol.py
index 03d921abf11..c93aabd80cd 100644
--- a/lib/subunit/python/subunit/tests/test_test_protocol.py
+++ b/lib/subunit/python/subunit/tests/test_test_protocol.py
@@ -22,11 +22,18 @@ from testtools import skipIf, TestCase
from testtools.compat import _b, _u, BytesIO, StringIO
from testtools.content import Content, TracebackContent
from testtools.content_type import ContentType
-from testtools.tests.helpers import (
- Python26TestResult,
- Python27TestResult,
- ExtendedTestResult,
- )
+try:
+ from testtools.testresult.doubles import (
+ Python26TestResult,
+ Python27TestResult,
+ ExtendedTestResult,
+ )
+except ImportError:
+ from testtools.tests.helpers import (
+ Python26TestResult,
+ Python27TestResult,
+ ExtendedTestResult,
+ )
import subunit
from subunit import _remote_exception_str, _remote_exception_str_chunked
diff --git a/lib/subunit/setup.py b/lib/subunit/setup.py
index 2038d048260..bb51a24fccc 100755
--- a/lib/subunit/setup.py
+++ b/lib/subunit/setup.py
@@ -9,7 +9,7 @@ except ImportError:
else:
extra = {
'install_requires': [
- 'testtools>=0.9.6',
+ 'testtools>=0.9.11',
]
}