summaryrefslogtreecommitdiff
path: root/python/subunit/__init__.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2011-04-25 11:09:54 +1200
committerRobert Collins <robertc@robertcollins.net>2011-04-25 11:09:54 +1200
commit86cff2f184f6bbd34fd330bae739a29a34a78d2a (patch)
treef12e16329989ee0ea9e20b2e49e20f1f46516d74 /python/subunit/__init__.py
parentb21965301c3ab72e5e19848d1019ca2d8e83da50 (diff)
downloadsubunit-git-86cff2f184f6bbd34fd330bae739a29a34a78d2a.tar.gz
Progress.
Diffstat (limited to 'python/subunit/__init__.py')
-rw-r--r--python/subunit/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index 281c3dd..6a46a40 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -185,6 +185,7 @@ class _ParserState(object):
def __init__(self, parser):
self.parser = parser
+ self._test_sym = (_b('test'), _b('testing'))
def addError(self, offset, line):
"""An 'error:' directive has been read."""
@@ -213,7 +214,7 @@ class _ParserState(object):
cmd, rest = parts
offset = len(cmd) + 1
cmd = cmd.rstrip(_b(':'))
- if cmd in ('test', 'testing'):
+ if cmd in self._test_sym:
self.startTest(offset, line)
elif cmd == 'error':
self.addError(offset, line)
@@ -332,8 +333,9 @@ class _OutSideTest(_ParserState):
def startTest(self, offset, line):
"""A test start command received."""
self.parser._state = self.parser._in_test
- self.parser._current_test = RemotedTestCase(line[offset:-1])
- self.parser.current_test_description = line[offset:-1]
+ test_name = line[offset:-1].decode('utf8')
+ self.parser._current_test = RemotedTestCase(test_name)
+ self.parser.current_test_description = test_name
self.parser.client.startTest(self.parser._current_test)
self.parser.subunitLineReceived(line)
@@ -1138,6 +1140,7 @@ def get_default_formatter():
def _make_stream_binary(stream):
"""Ensure that a stream will be binary safe. See _make_binary_on_windows."""
if getattr(stream, 'fileno', None) is not None:
+ print (stream, type(stream))
_make_binary_on_windows(stream.fileno())
def _make_binary_on_windows(fileno):