summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py2
-rw-r--r--python/subunit/details.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index bcba63e..7734852 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -619,6 +619,8 @@ class TestProtocolClient(unittest.TestResult):
raise ValueError
if error is not None:
self._stream.write(" [\n")
+ # 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_string(error, test).splitlines():
self._stream.write("%s\n" % line)
else:
diff --git a/python/subunit/details.py b/python/subunit/details.py
index acd6d0d..a37b2ac 100644
--- a/python/subunit/details.py
+++ b/python/subunit/details.py
@@ -47,8 +47,12 @@ class SimpleDetailsParser(DetailsParser):
def get_details(self, style=None):
result = {}
if not style:
+ # We know that subunit/testtools serialise [] formatted
+ # tracebacks as utf8, but perhaps we need a ReplacingContent
+ # or something like that.
result['traceback'] = content.Content(
- content_type.ContentType("text", "x-traceback"),
+ content_type.ContentType("text", "x-traceback",
+ {"charset": "utf8"}),
lambda:[self._message])
else:
if style == 'skip':