def _test_stdinReader(self, pyExe, args, env, path):
        """
        Spawn a process, write to stdin, and check the output.
        """
        p = Accumulator()
        d = p.endedDeferred = defer.Deferred()
        reactor.spawnProcess(p, pyExe, args, env, path)
        p.transport.write(b"hello, world")
        p.transport.closeStdin()

        def processEnded(ign):
            self.assertEqual(p.errF.getvalue(), b"err\nerr\n")
            self.assertEqual(p.outF.getvalue(), b"out\nhello, world\nout\n")
        return d.addCallback(processEnded)

        Spawn a process, write to stdin, and check the output.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py