def test_asFutureFailure(self):
        """
        L{defer.Deferred.asFuture} makes a L{asyncio.Future} fire with an
        exception when the given L{defer.Deferred} does.
        """
        d = defer.Deferred()
        theFailure = failure.Failure(ZeroDivisionError())
        loop = new_event_loop()
        future = d.asFuture(loop)
        callAllSoonCalls(loop)
        d.errback(theFailure)
        callAllSoonCalls(loop)
        self.assertRaises(ZeroDivisionError, future.result)

        L{defer.Deferred.asFuture} makes a L{asyncio.Future} fire with an
        exception when the given L{defer.Deferred} does.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_defer.py