diff options
| author | Jonathan Lange <jml@canonical.com> | 2008-06-19 10:55:24 +1000 |
|---|---|---|
| committer | Jonathan Lange <jml@canonical.com> | 2008-06-19 10:55:24 +1000 |
| commit | 150a47e415a72cf43b06b024faf8ea7aee0ab281 (patch) | |
| tree | d1984a9157cbb01e7e29906ee1f2f8d1b17aff7c | |
| parent | 430fb492198e04da4f1331c2357147f53938613d (diff) | |
| download | subunit-git-150a47e415a72cf43b06b024faf8ea7aee0ab281.tar.gz | |
Split tracebacks by *line* rather than by any whitespace.
| -rw-r--r-- | python/subunit/__init__.py | 4 | ||||
| -rw-r--r-- | python/subunit/tests/test_test_protocol.py | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 5ee25d1..f52dbaa 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -215,14 +215,14 @@ class TestProtocolClient(unittest.TestResult): def addError(self, test, error): """Report an error in test test.""" self._stream.write("error: %s [\n" % test.id()) - for line in self._exc_info_to_string(error, test).split(): + for line in self._exc_info_to_string(error, test).splitlines(): self._stream.write("%s\n" % line) self._stream.write("]\n") def addFailure(self, test, error): """Report a failure in test test.""" self._stream.write("failure: %s [\n" % test.id()) - for line in self._exc_info_to_string(error, test).split(): + for line in self._exc_info_to_string(error, test).splitlines(): self._stream.write("%s\n" % line) self._stream.write("]\n") diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index 5fd8e36..0b9fc77 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -709,19 +709,20 @@ class TestTestProtocolClient(unittest.TestCase): def test_add_failure(self): """Test addFailure on a TestProtocolClient.""" - self.protocol.addFailure(self.test, subunit.RemoteError("boo")) + self.protocol.addFailure( + self.test, subunit.RemoteError("boo qux")) self.assertEqual( self.io.getvalue(), - 'failure: %s [\nRemoteException:\nboo\n]\n' % self.test.id()) + 'failure: %s [\nRemoteException: boo qux\n]\n' % self.test.id()) def test_add_error(self): """Test stopTest on a TestProtocolClient.""" - self.protocol.addError(self.test, subunit.RemoteError("phwoar")) + self.protocol.addError( + self.test, subunit.RemoteError("phwoar crikey")) self.assertEqual( self.io.getvalue(), 'error: %s [\n' - "RemoteException:\n" - "phwoar\n" + "RemoteException: phwoar crikey\n" "]\n" % self.test.id()) |
