Comment 1 for bug 816709

Revision history for this message
Jonathan Lange (jml) wrote :

This error::

======================================================================
ERROR: testtools.tests.test_testcase.TestDetailsProvided.test_addDetail
----------------------------------------------------------------------
_StringException: lost connection during success report of test 'testtools.tests.test_testcase.TestDetailsProvided.test_addDetail'

was because the subunit stream was corrupted, which was in turn because a test was adding content with strings rather than bytes.

Fixed by this::

=== modified file 'testtools/tests/test_testcase.py'
--- a/testtools/tests/test_testcase.py 2011-07-21 09:39:52 +0000
+++ b/testtools/tests/test_testcase.py 2011-07-26 23:48:11 +0000
@@ -18,6 +18,7 @@
     skipUnless,
     testcase,
     )
+from testtools.compat import _b
 from testtools.matchers import (
     Equals,
     MatchesException,
@@ -714,7 +715,7 @@

     def get_content(self):
         return content.Content(
- content.ContentType("text", "foo"), lambda: ['foo'])
+ content.ContentType("text", "foo"), lambda: [_b('foo')])

 class TestExpectedFailure(TestWithDetails):

Note that when running the tests with testtools.run everything looked fine. I find that worrying.