def processEnded(reason):
            """
            Asserts that the parent received the bytes written by the child
            immediately after the child starts.
            """
            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)

            Asserts that the parent received the bytes written by the child
            immediately after the child starts.
            
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_stdio.py