From 1fcae436eddfb4bf36fd99ddde1558b526f3ccdb Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sat, 16 Jan 2010 10:02:12 +1100 Subject: Only take commands that start the line they are observed on. --- python/subunit/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/subunit/__init__.py') diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index 6e8df90..73dbc17 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -213,10 +213,10 @@ class _ParserState(object): def lineReceived(self, line): """a line has been received.""" parts = line.split(None, 1) - if len(parts) == 2: + if len(parts) == 2 and line.startswith(parts[0]): cmd, rest = parts offset = len(cmd) + 1 - cmd = cmd.strip(':') + cmd = cmd.rstrip(':') if cmd in ('test', 'testing'): self.startTest(offset, line) elif cmd == 'error': -- cgit v1.2.1