diff options
| author | Martin <gzlist@googlemail.com> | 2011-04-25 22:26:51 +0100 |
|---|---|---|
| committer | Martin <gzlist@googlemail.com> | 2011-04-25 22:26:51 +0100 |
| commit | 4b6abb5335d793f842abaab3121276c7737481a0 (patch) | |
| tree | 85ef8ef89a3d90ce14e70bfdc569aef400f63afd /python | |
| parent | 93731a8e206c5a9bc73b682f9ac2716ae5ad3977 (diff) | |
| download | subunit-git-4b6abb5335d793f842abaab3121276c7737481a0.tar.gz | |
Avoid leaking test output in TestTestProtocolServerStartTest.test_indented_test_colon_ignored
Diffstat (limited to 'python')
| -rw-r--r-- | python/subunit/tests/test_test_protocol.py | 7 |
1 files changed, 5 insertions, 2 deletions
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")) |
