def test_addReader(self):
        """
        C{reactor.addReader()} accepts an L{IReadDescriptor} provider and calls
        its C{doRead} method when there may be data available on its C{fileno}.
        """
        reactor, fd, server = self._simpleSetup()

        def removeAndStop():
            reactor.removeReader(fd)
            reactor.stop()
        fd.doRead = removeAndStop
        reactor.addReader(fd)
        server.sendall(b'x')

        # The reactor will only stop if it calls fd.doRead.
        self.runReactor(reactor)
        # Nothing to assert, just be glad we got this far.

        C{reactor.addReader()} accepts an L{IReadDescriptor} provider and calls
        its C{doRead} method when there may be data available on its C{fileno}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_fdset.py