def test_readInterrupted(self):
        """
        If reading the input stream fails with a C{IOError} with errno
        C{EINTR}, L{main} ignores it and continues reading.
        """
        excInfos = []

        class FakeStream(object):
            count = 0

            def read(oself, size):
                oself.count += 1
                if oself.count == 1:
                    raise IOError(errno.EINTR)
                else:
                    excInfos.append(sys.exc_info())
                return b''

        self.readStream = FakeStream()
        main(self.fdopen)
        self.assertEqual(b'', self.writeStream.getvalue())
        self.assertEqual([(None, None, None)], excInfos)

        If reading the input stream fails with a C{IOError} with errno
        C{EINTR}, L{main} ignores it and continues reading.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/_dist/test/test_workertrial.py