From ee70ef7909b72b4dd2231dbd3fdf188deebfd284 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Wed, 18 Mar 2009 20:33:42 +1100 Subject: Fix python issue with ProtocolTestCase: file.readline() gets a line immediately, file.readlines(), when file is a pipe/socket, requires a full buffer and thus gives very large chunks of tests rather than small groups, making concurrent-test-mixing somewhat hard. --- python/subunit/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 9f7dd64..3402ae5 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -652,8 +652,10 @@ class ProtocolTestCase(object): if result is None: result = self.defaultTestResult() protocol = TestProtocolServer(result) - for line in self._stream: + line = self._stream.readline() + while line: protocol.lineReceived(line) + line = self._stream.readline() protocol.lostConnection() -- cgit v1.2.1