summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2010-06-24 20:02:35 +1000
committerRobert Collins <robertc@robertcollins.net>2010-06-24 20:02:35 +1000
commit1faaf17e58444d000bc13bb6695f85dfdea496c7 (patch)
tree9a937c879f2678971bd054140c460e8fc7e7213d /python
parent62523dfa4e108995245c53b211a077edee1b586f (diff)
downloadsubunit-git-1faaf17e58444d000bc13bb6695f85dfdea496c7.tar.gz
Fix make check with testtools trunk.
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py12
-rw-r--r--python/subunit/tests/test_test_protocol.py26
2 files changed, 19 insertions, 19 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index 7734852..8d6da1e 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -244,7 +244,7 @@ class _ParserState(object):
def lostConnection(self):
"""Connection lost."""
- self.parser._lostConnectionInTest('unknown state of ')
+ self.parser._lostConnectionInTest(u'unknown state of ')
def startTest(self, offset, line):
"""A test start command received."""
@@ -324,7 +324,7 @@ class _InTest(_ParserState):
def lostConnection(self):
"""Connection lost."""
- self.parser._lostConnectionInTest('')
+ self.parser._lostConnectionInTest(u'')
class _OutSideTest(_ParserState):
@@ -359,7 +359,7 @@ class _ReadingDetails(_ParserState):
def lostConnection(self):
"""Connection lost."""
- self.parser._lostConnectionInTest('%s report of ' %
+ self.parser._lostConnectionInTest(u'%s report of ' %
self._outcome_label())
def _outcome_label(self):
@@ -501,7 +501,7 @@ class TestProtocolServer(object):
self._state.lineReceived(line)
def _lostConnectionInTest(self, state_string):
- error_string = "lost connection during %stest '%s'" % (
+ error_string = u"lost connection during %stest '%s'" % (
state_string, self.current_test_description)
self.client.addError(self._current_test, RemoteError(error_string))
self.client.stopTest(self._current_test)
@@ -707,7 +707,7 @@ class TestProtocolClient(unittest.TestResult):
"""Obey the testtools result.done() interface."""
-def RemoteError(description=""):
+def RemoteError(description=u""):
return (_StringException, _StringException(description), None)
@@ -757,7 +757,7 @@ class RemotedTestCase(unittest.TestCase):
def run(self, result=None):
if result is None: result = self.defaultTestResult()
result.startTest(self)
- result.addError(self, RemoteError("Cannot run RemotedTestCases.\n"))
+ result.addError(self, RemoteError(u"Cannot run RemotedTestCases.\n"))
result.stopTest(self)
def _strclass(self):
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index ea4a447..e1287b6 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -289,7 +289,7 @@ class TestTestProtocolServerLostConnection(unittest.TestCase):
self.protocol.lineReceived("test old mcdonald\n")
self.protocol.lostConnection()
failure = subunit.RemoteError(
- "lost connection during test 'old mcdonald'")
+ u"lost connection during test 'old mcdonald'")
self.assertEqual([
('startTest', self.test),
('addError', self.test, failure),
@@ -302,7 +302,7 @@ class TestTestProtocolServerLostConnection(unittest.TestCase):
self.protocol.lostConnection()
self.assertEqual([
('startTest', self.test),
- ('addError', self.test, subunit.RemoteError("")),
+ ('addError', self.test, subunit.RemoteError(u"")),
('stopTest', self.test),
], self.client._events)
@@ -311,7 +311,7 @@ class TestTestProtocolServerLostConnection(unittest.TestCase):
self.protocol.lineReceived("%s old mcdonald %s" % (outcome, opening))
self.protocol.lostConnection()
failure = subunit.RemoteError(
- "lost connection during %s report of test 'old mcdonald'" %
+ u"lost connection during %s report of test 'old mcdonald'" %
outcome)
self.assertEqual([
('startTest', self.test),
@@ -331,7 +331,7 @@ class TestTestProtocolServerLostConnection(unittest.TestCase):
self.protocol.lostConnection()
self.assertEqual([
('startTest', self.test),
- ('addFailure', self.test, subunit.RemoteError("")),
+ ('addFailure', self.test, subunit.RemoteError(u"")),
('stopTest', self.test),
], self.client._events)
@@ -545,7 +545,7 @@ class TestTestProtocolServerAddxFail(unittest.TestCase):
value = details
else:
if error_message is not None:
- value = subunit.RemoteError('Text attachment: traceback\n'
+ value = subunit.RemoteError(u'Text attachment: traceback\n'
'------------\n' + error_message + '------------\n')
else:
value = subunit.RemoteError()
@@ -850,15 +850,15 @@ class TestRemotedTestCase(unittest.TestCase):
class TestRemoteError(unittest.TestCase):
def test_eq(self):
- error = subunit.RemoteError("Something went wrong")
- another_error = subunit.RemoteError("Something went wrong")
- different_error = subunit.RemoteError("boo!")
+ error = subunit.RemoteError(u"Something went wrong")
+ another_error = subunit.RemoteError(u"Something went wrong")
+ different_error = subunit.RemoteError(u"boo!")
self.assertEqual(error, another_error)
self.assertNotEqual(error, different_error)
self.assertNotEqual(different_error, another_error)
def test_empty_constructor(self):
- self.assertEqual(subunit.RemoteError(), subunit.RemoteError(""))
+ self.assertEqual(subunit.RemoteError(), subunit.RemoteError(u""))
class TestExecTestCase(unittest.TestCase):
@@ -1009,7 +1009,7 @@ class TestTestProtocolClient(unittest.TestCase):
ContentType('text', 'plain'), lambda:['serialised\nform'])}
self.sample_tb_details = dict(self.sample_details)
self.sample_tb_details['traceback'] = TracebackContent(
- subunit.RemoteError("boo qux"), self.test)
+ subunit.RemoteError(u"boo qux"), self.test)
def test_start_test(self):
"""Test startTest on a TestProtocolClient."""
@@ -1039,7 +1039,7 @@ class TestTestProtocolClient(unittest.TestCase):
def test_add_failure(self):
"""Test addFailure on a TestProtocolClient."""
self.protocol.addFailure(
- self.test, subunit.RemoteError("boo qux"))
+ self.test, subunit.RemoteError(u"boo qux"))
self.assertEqual(
self.io.getvalue(),
('failure: %s [\n' + _remote_exception_str + ': boo qux\n]\n')
@@ -1063,7 +1063,7 @@ class TestTestProtocolClient(unittest.TestCase):
def test_add_error(self):
"""Test stopTest on a TestProtocolClient."""
self.protocol.addError(
- self.test, subunit.RemoteError("phwoar crikey"))
+ self.test, subunit.RemoteError(u"phwoar crikey"))
self.assertEqual(
self.io.getvalue(),
('error: %s [\n' +
@@ -1088,7 +1088,7 @@ class TestTestProtocolClient(unittest.TestCase):
def test_add_expected_failure(self):
"""Test addExpectedFailure on a TestProtocolClient."""
self.protocol.addExpectedFailure(
- self.test, subunit.RemoteError("phwoar crikey"))
+ self.test, subunit.RemoteError(u"phwoar crikey"))
self.assertEqual(
self.io.getvalue(),
('xfail: %s [\n' +