def test_stdout(self):
        """
        ProcessProtocol.transport.closeStdout actually closes the pipe.
        """
        d = self.doit(1)
        def _check(errput):
            if _PY3:
                if runtime.platform.isWindows():
                    self.assertIn(b"OSError", errput)
                    self.assertIn(b"22", errput)
                else:
                    self.assertIn(b'BrokenPipeError', errput)
            else:
                self.assertIn(b'OSError', errput)
            if runtime.platform.getType() != 'win32':
                self.assertIn(b'Broken pipe', errput)
        d.addCallback(_check)
        return d

        ProcessProtocol.transport.closeStdout actually closes the pipe.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py