

def __init__(self, client, stream=None, forward_stream=None):
    'Create a TestProtocolServer instance.\n\n        :param client: An object meeting the unittest.TestResult protocol.\n        :param stream: The stream that lines received which are not part of the\n            subunit protocol should be written to. This allows custom handling\n            of mixed protocols. By default, sys.stdout will be used for\n            convenience. It should accept bytes to its write() method.\n        :param forward_stream: A stream to forward subunit lines to. This\n            allows a filter to forward the entire stream while still parsing\n            and acting on it. By default forward_stream is set to\n            DiscardStream() and no forwarding happens.\n        '
    self.client = ExtendedToOriginalDecorator(client)
    if (stream is None):
        stream = sys.stdout
        if (sys.version_info > (3, 0)):
            stream = stream.buffer
    self._stream = stream
    self._forward_stream = (forward_stream or DiscardStream())
    self._in_test = _InTest(self)
    self._outside_test = _OutSideTest(self)
    self._reading_error_details = _ReadingErrorDetails(self)
    self._reading_failure_details = _ReadingFailureDetails(self)
    self._reading_skip_details = _ReadingSkipDetails(self)
    self._reading_success_details = _ReadingSuccessDetails(self)
    self._reading_xfail_details = _ReadingExpectedFailureDetails(self)
    self._reading_uxsuccess_details = _ReadingUnexpectedSuccessDetails(self)
    self._state = self._outside_test
    self._plusminus = _b('+-')
    self._push_sym = _b('push')
    self._pop_sym = _b('pop')

dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/external/subunit/__init__.py TestProtocolServer.__init__/original