From e0fe5856dce0725841d54b6be2c3c8d70f89a0b5 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 25 Apr 2011 22:26:51 +0100 Subject: Avoid leaking test output in TestTestProtocolServerStartTest.test_indented_test_colon_ignored --- python/subunit/tests/test_test_protocol.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index 7ec7758..d8af230 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -107,7 +107,8 @@ class TestTestProtocolServerStartTest(unittest.TestCase): def setUp(self): self.client = Python26TestResult() - self.protocol = subunit.TestProtocolServer(self.client) + self.stream = BytesIO() + self.protocol = subunit.TestProtocolServer(self.client, self.stream) def test_start_test(self): self.protocol.lineReceived(_b("test old mcdonald\n")) @@ -125,8 +126,10 @@ class TestTestProtocolServerStartTest(unittest.TestCase): [('startTest', subunit.RemotedTestCase("old mcdonald"))]) def test_indented_test_colon_ignored(self): - self.protocol.lineReceived(_b(" test: old mcdonald\n")) + ignored_line = _b(" test: old mcdonald\n") + self.protocol.lineReceived(ignored_line) self.assertEqual([], self.client._events) + self.assertEqual(self.stream.getvalue(), ignored_line) def test_start_testing_colon(self): self.protocol.lineReceived(_b("testing: old mcdonald\n")) -- cgit v1.2.1