summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2006-12-19 16:13:53 +1100
committerJonathan Lange <jml@mumak.net>2006-12-19 16:13:53 +1100
commitc42cac02dc84b8db42f3c85f36affdaf732245a1 (patch)
tree2fa37a73b5b41a4c3420bffd073b51a93501c474 /python
parent472b3ae396f3649158cbd776e42bda53a8f800a8 (diff)
downloadsubunit-git-c42cac02dc84b8db42f3c85f36affdaf732245a1.tar.gz
Return a valid exc_info tuple from RemoteError
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py2
-rw-r--r--python/subunit/tests/test_test_protocol.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index 922c53f..1fc34ec 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -218,7 +218,7 @@ class TestProtocolClient(unittest.TestResult):
def RemoteError(description=""):
if description == "":
description = "\n"
- return (RemoteException("RemoteError:\n%s" % description), None, None)
+ return (RemoteException, RemoteException(description), None)
class RemotedTestCase(unittest.TestCase):
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index ae5af0c..98d74fe 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -139,10 +139,10 @@ class TestTestProtocolServerPipe(unittest.TestCase):
bing = subunit.RemotedTestCase("bing crosby")
an_error = subunit.RemotedTestCase("an error")
self.assertEqual(client.errors,
- [(an_error, 'RemoteError:\n\n\n')])
- self.assertEqual(client.failures,
- [(bing,
- "RemoteError:\nfoo.c:53:ERROR invalid state\n\n")])
+ [(an_error, 'RemoteException: \n\n')])
+ self.assertEqual(
+ client.failures,
+ [(bing, "RemoteException: foo.c:53:ERROR invalid state\n\n")])
self.assertEqual(client.testsRun, 3)
@@ -532,7 +532,7 @@ class TestRemotedTestCase(unittest.TestCase):
"'A test description'>", "%r" % test)
result = unittest.TestResult()
test.run(result)
- self.assertEqual([(test, "RemoteError:\n"
+ self.assertEqual([(test, "RemoteException: "
"Cannot run RemotedTestCases.\n\n")],
result.errors)
self.assertEqual(1, result.testsRun)
@@ -705,7 +705,7 @@ class TestTestProtocolClient(unittest.TestCase):
self.protocol.addFailure(self.test, subunit.RemoteError("boo"))
self.assertEqual(self.io.getvalue(), "failure: Test startTest on a "
"TestProtocolClient. [\n"
- "RemoteError:\n"
+ "RemoteException:\n"
"boo\n"
"]\n")
@@ -714,7 +714,7 @@ class TestTestProtocolClient(unittest.TestCase):
self.protocol.addError(self.test, subunit.RemoteError("phwoar"))
self.assertEqual(self.io.getvalue(), "error: Test startTest on a "
"TestProtocolClient. [\n"
- "RemoteError:\n"
+ "RemoteException:\n"
"phwoar\n"
"]\n")