'L{defer.Deferred.asFuture} makes a L{asyncio.Future} fire with an
exception when the given L{defer.Deferred} does.'

def test_asFutureFailure(self):

    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)
