diff options
author | Robert Collins <robertc@robertcollins.net> | 2015-03-10 14:03:25 +1300 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2015-03-10 14:03:25 +1300 |
commit | e4b73c9e3ae312995bfffb6fd9d7e5ab01efbbb6 (patch) | |
tree | 6172e04d386c577f61b80b769ea87f28de2957cf | |
parent | 669f0dbc8a993d203c0dbc874419cc2fb8c5441c (diff) | |
download | subunit-1.1.0.tar.gz |
Support --locals in tracebacks and release 1.1.01.1.0
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | python/subunit/__init__.py | 2 | ||||
-rwxr-xr-x | python/subunit/run.py | 5 | ||||
-rw-r--r-- | python/subunit/tests/__init__.py | 10 |
5 files changed, 16 insertions, 9 deletions
@@ -14,6 +14,12 @@ BUGFIXES * SUBUNIT_FORMATTER which has not been honoured for years is now removed from the codebase. (Jelmer Vernooij) +IMPROVEMENTS +~~~~~~~~~~~~ + +* ``subunit.run`` now supports ``--locals`` to show local variables in + tracebacks. (Robert Collins) + 1.0.0 ----- diff --git a/configure.ac b/configure.ac index 47071c5..a7891a1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ m4_define([SUBUNIT_MAJOR_VERSION], [1]) -m4_define([SUBUNIT_MINOR_VERSION], [0]) +m4_define([SUBUNIT_MINOR_VERSION], [1]) m4_define([SUBUNIT_MICRO_VERSION], [0]) m4_define([SUBUNIT_VERSION], m4_defn([SUBUNIT_MAJOR_VERSION]).m4_defn([SUBUNIT_MINOR_VERSION]).m4_defn([SUBUNIT_MICRO_VERSION])) diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index bfa27a1..7d864e8 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -153,7 +153,7 @@ from subunit.v2 import ByteStreamToStreamResult, StreamResultToBytes # If the releaselevel is 'final', then the tarball will be major.minor.micro. # Otherwise it is major.minor.micro~$(revno). -__version__ = (1, 0, 0, 'final', 0) +__version__ = (1, 1, 0, 'final', 0) PROGRESS_SET = 0 PROGRESS_CUR = 1 diff --git a/python/subunit/run.py b/python/subunit/run.py index 8469ac9..6b20351 100755 --- a/python/subunit/run.py +++ b/python/subunit/run.py @@ -40,7 +40,7 @@ from testtools.run import ( class SubunitTestRunner(object): def __init__(self, verbosity=None, failfast=None, buffer=None, stream=None, - stdout=None): + stdout=None, tb_locals=False): """Create a TestToolsTestRunner. :param verbosity: Ignored. @@ -48,12 +48,14 @@ class SubunitTestRunner(object): :param buffer: Ignored. :param stream: Upstream unittest stream parameter. :param stdout: Testtools stream parameter. + :param tb_locals: Testtools traceback in locals parameter. Either stream or stdout can be supplied, and stream will take precedence. """ self.failfast = failfast self.stream = stream or stdout or sys.stdout + self.tb_locals = tb_locals def run(self, test): "Run the given test case or test suite." @@ -62,6 +64,7 @@ class SubunitTestRunner(object): result = AutoTimingTestResultDecorator(result) if self.failfast is not None: result.failfast = self.failfast + result.tb_locals = self.tb_locals result.startTestRun() try: test(result) diff --git a/python/subunit/tests/__init__.py b/python/subunit/tests/__init__.py index c1c2c64..ae772e7 100644 --- a/python/subunit/tests/__init__.py +++ b/python/subunit/tests/__init__.py @@ -22,14 +22,12 @@ from testscenarios import generate_scenarios # Before the test module imports to avoid circularity. # For testing: different pythons have different str() implementations. -if sys.version_info > (3, 0): +if (3,1) < sys.version_info < (3, 4): _remote_exception_repr = "testtools.testresult.real._StringException" - _remote_exception_str = "Traceback (most recent call last):\ntesttools.testresult.real._StringException" - _remote_exception_str_chunked = "57\r\n" + _remote_exception_str + ": boo qux\n0\r\n" else: - _remote_exception_repr = "_StringException" - _remote_exception_str = "Traceback (most recent call last):\n_StringException" - _remote_exception_str_chunked = "3D\r\n" + _remote_exception_str + ": boo qux\n0\r\n" + _remote_exception_repr = "_StringException" +_remote_exception_str = "Traceback (most recent call last):\ntesttools.testresult.real._StringException" +_remote_exception_str_chunked = "57\r\n" + _remote_exception_str + ": boo qux\n0\r\n" from subunit.tests import ( |