def METHOD_NAME(self):
    def handler(exc_typ, exc_val, exc_tb):
        self.stop(exc_val)
        return True  # Halt propagation.
    with ExceptionStackContext(handler):
        self.resolver.resolve('an invalid domain', 80, callback=self.stop)
    result = self.wait()
    self.assertIsInstance(result, Exception)