'Verify that a write made directly to stdout using L{os.write}
after StandardIO has finished is reliably received by the
process reading that stdout.'

def test_lastWriteReceived(self):

    p = StandardIOTestProcessProtocol()
    try:
        self._spawnProcess(p, 'stdio_test_lastwrite', UNIQUE_LAST_WRITE_STRING, usePTY=True)
    except ValueError as e:
        raise unittest.SkipTest(str(e))
    def processEnded(reason):
        '\n                                                Asserts    that    the    parent    received    the    bytes    written    by    the    child\n                                                immediately    after    the    child    starts.\n                                                '
        self.assertTrue(p.data[1].endswith(UNIQUE_LAST_WRITE_STRING), ('Received    %r    from    child,    did    not    find    expected    bytes.' % (p.data,)))
        reason.trap(error.ProcessDone)
    return self._requireFailure(p.onCompletion, processEnded)
