def METHOD_NAME(func):
    def wrapper(*args, **kargs):
        q = Queue()
        def callback(value):
            q.put(None)
        def errback(failure):
            # Retrieve and save full exception info
            try:
                failure.raiseException()
            except:
                q.put(sys.exc_info())
        def g():
            try:
                d = func(*args, **kargs)
                try:
                    d.addCallbacks(callback, errback)
                # Check for a common mistake and display a nice error
                # message
                except AttributeError:
                    raise TypeError("you must return a twisted Deferred "
                                    "from your test case!")
            # Catch exceptions raised in the test body (from the
            # Twisted thread)
            except:
                q.put(sys.exc_info())
        reactor.callFromThread(g)
        try:
            error = q.get(timeout=timeout)
        except Empty:
            raise TimeExpired("timeout expired before end of test (%f s.)"
                              % timeout)
        # Re-raise all exceptions
        if error is not None:
            exc_type, exc_value, tb = error
            raise exc_type, exc_value, tb
    wrapper = make_decorator(func)(wrapper)
    return wrapper