def test_forwardCommand(self):
        """
        L{main} forwards data from its input stream to a L{WorkerProtocol}
        instance which writes data to the output stream.
        """
        client = FakeAMP()
        clientTransport = StringTransport()
        client.makeConnection(clientTransport)
        client.callRemote(workercommands.Run, testCase="doesntexist")
        self.readStream = clientTransport.io
        self.readStream.seek(0, 0)
        main(self.fdopen)
        self.assertIn(
            b"No module named 'doesntexist'", self.writeStream.getvalue())

        L{main} forwards data from its input stream to a L{WorkerProtocol}
        instance which writes data to the output stream.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/_dist/test/test_workertrial.py