
4 Sep
2004
4 Sep
'04
12:19 a.m.
Paul Campbell wrote:
Here's the situation...
I've been writing all my code to defer correctly. Every time it gets to a point where the call can block, I've inserted the appropriate callback function.
However, it occurred to me (for testing purposes) that it would be nice some times to INTENTIONALLY block.
Trial exposes some utilities for this. twisted.trial.util.wait() is the most useful of them. It takes a Deferred. It returns the result of the Deferred, or raises an exception if the Deferred fails. It supports timeouts, and by default will fail after 10 seconds if no result arrives.
Jp