summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2012-02-09 18:04:37 +0000
committerJonathan Lange <jml@canonical.com>2012-02-09 18:04:37 +0000
commitc4e8b3bf04e185a2bae6eaf5f137a02f6e1b5fad (patch)
treee0bfdcec0794316b130690c71fa16b0be6d3ba34 /python
parent8343524a5ee5f459e87bc15c85558a33a867f35a (diff)
downloadsubunit-git-c4e8b3bf04e185a2bae6eaf5f137a02f6e1b5fad.tar.gz
Fix to call the public API in testtools.
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index b4c9397..2b494de 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -123,6 +123,7 @@ import sys
import unittest
from testtools import content, content_type, ExtendedToOriginalDecorator
+from testtools.content import TracebackContent
from testtools.compat import _b, _u, BytesIO, StringIO
try:
from testtools.testresult.real import _StringException
@@ -682,10 +683,9 @@ class TestProtocolClient(testresult.TestResult):
raise ValueError
if error is not None:
self._stream.write(self._start_simple)
- # XXX: this needs to be made much stricter, along the lines of
- # Martin[gz]'s work in testtools. Perhaps subunit can use that?
- for line in self._exc_info_to_unicode(error, test).splitlines():
- self._stream.write(("%s\n" % line).encode('utf8'))
+ content = TracebackContent(error, test)
+ for bytes in content.iter_bytes():
+ self._stream.write(bytes)
elif details is not None:
self._write_details(details)
else: