'``assertFailure`` returns the exception if the deferred fires with a
failure.'

def test_failure(self):

    class Tests(AsyncTestCase, ):
        def test_success(self):
            exc = CustomException()
            d = self.assertFailure(fail(exc), type(exc))
            d.addCallback((lambda exception: self.assertThat(exception, Equals(exc))))
            return d
    result = run_test(Tests('test_success'))
    self.assertThat(result, has_results(tests_run=Equals(1)))
