def test_deferred(self):
        """
        When a deferred is returned to the manhole REPL, it is displayed with
        a sequence number, and when the deferred fires, the result is printed.
        """
        self._testwrite(
            b"from twisted.internet import defer, reactor\n"
            b"d = defer.Deferred()\n"
            b"d\n")

        yield self.recvlineClient.expect(b"<Deferred #0>")

        self._testwrite(
            b"c = reactor.callLater(0.1, d.callback, 'Hi!')\n")
        yield self.recvlineClient.expect(b">>> ")

        yield self.recvlineClient.expect(
            b"Deferred #0 called back: 'Hi!'\n>>> ")
        self._assertBuffer(
            [b">>> from twisted.internet import defer, reactor",
             b">>> d = defer.Deferred()",
             b">>> d",
             b"<Deferred #0>",
             b">>> c = reactor.callLater(0.1, d.callback, 'Hi!')",
             b"Deferred #0 called back: 'Hi!'",
             b">>> "])

        When a deferred is returned to the manhole REPL, it is displayed with
        a sequence number, and when the deferred fires, the result is printed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_manhole.py