def test_listen(self):
        """
        L{IReactorTCP.listenTCP} returns an object which provides
        L{IListeningPort}.
        """
        f = MyServerFactory()
        p1 = reactor.listenTCP(0, f, interface="127.0.0.1")
        self.addCleanup(p1.stopListening)
        self.assertTrue(interfaces.IListeningPort.providedBy(p1))

        L{IReactorTCP.listenTCP} returns an object which provides
        L{IListeningPort}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_tcp.py