summaryrefslogtreecommitdiff
path: root/python/subunit/tests/test_test_protocol.py
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2012-02-09 19:01:04 +0000
committerJonathan Lange <jml@canonical.com>2012-02-09 19:01:04 +0000
commitf1f773607b070d0b91946ff638931ca8c8bd682d (patch)
treec4acbe6945a4ec94f7fdbbd838ab4db8ef08d2af /python/subunit/tests/test_test_protocol.py
parent02b8123129dc097b63902790b6b279e6c4afdd06 (diff)
downloadsubunit-git-f1f773607b070d0b91946ff638931ca8c8bd682d.tar.gz
Code that works for 0.9.11 and against testtools trunk
Diffstat (limited to 'python/subunit/tests/test_test_protocol.py')
-rw-r--r--python/subunit/tests/test_test_protocol.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index 1c8bc05..e0710f4 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -18,11 +18,10 @@ import datetime
import unittest
import os
-from testtools import skipIf, TestCase
+from testtools import skipIf, TestCase, TestResult
from testtools.compat import _b, _u, BytesIO
from testtools.content import Content, TracebackContent, text_content
from testtools.content_type import ContentType
-from testtools.testresult.real import _details_to_str
try:
from testtools.testresult.doubles import (
Python26TestResult,
@@ -41,6 +40,10 @@ from subunit import _remote_exception_str, _remote_exception_str_chunked
import subunit.iso8601 as iso8601
+def details_to_str(details):
+ return TestResult()._err_details_to_string(None, details=details)
+
+
class TestTestImports(unittest.TestCase):
def test_imports(self):
@@ -105,7 +108,7 @@ class TestTestProtocolServerPipe(unittest.TestCase):
self.assertEqual(
client.failures,
[(bing, _remote_exception_str + ": "
- + _details_to_str({'traceback': text_content(traceback)}, 'traceback') + "\n")])
+ + details_to_str({'traceback': text_content(traceback)}) + "\n")])
self.assertEqual(client.testsRun, 3)
def test_non_test_characters_forwarded_immediately(self):
@@ -560,8 +563,7 @@ class TestTestProtocolServerAddxFail(unittest.TestCase):
value = details
else:
if error_message is not None:
- value = subunit.RemoteError(
- _details_to_str(details, special='traceback'))
+ value = subunit.RemoteError(details_to_str(details))
else:
value = subunit.RemoteError()
self.assertEqual([