def test_connectionLostOnRead(self):
        """
        If a C{doRead} returns a value indicating disconnection,
        C{connectionLost} is called on it.
        """
        reactor = Clock()
        poller = _ContinuousPolling(reactor)
        desc = Descriptor()
        desc.doRead = lambda: ConnectionDone()
        poller.addReader(desc)
        self.assertEqual(desc.events, [])
        reactor.advance(0.001)
        self.assertEqual(desc.events, ["lost"])

        If a C{doRead} returns a value indicating disconnection,
        C{connectionLost} is called on it.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_epollreactor.py