[Twisted-Python] Refactoring of trial - call for feature requests and suggestions

Christopher Armstrong radix at twistedmatrix.com
Tue Jun 15 12:26:00 EDT 2004


Brian Warner wrote:
>>What's the point of this, exactly? How would you assert things about the
>>result of the Deferred? I've been using the functions in twisted.trial.util
>>for a while to deal with Deferreds in my tests, and it seems rather nice.
> 
> 
> I assume the Deferred that comes back from the test case would merely be
> expected to fire the callback successfully, and the value passed to that
> callback would be ignored. Any result-checking would be done in chained
> callbacks that fired beforehand.
> 
> The Deferred would just be to tell trial that it should spin the reactor
> until the test completes. Oh, a feature request: please spin the reactor
> gently.. use iterate(0.01) instead of iterate(), to avoid spamming the CPU on
> tests that are gated by reactor.callLater. Also there should be a built-in
> timeout, or an easy way to set one (with a default timeout imposed if the
> method returns a Deferred without first setting a timeout).

I don't think it should be calling iterate() at all -- just a regular 
run(). In fact, I was considering rewriting said functions in 
twisted.trial.util to use that just today. Instead of spinning the 
reactor until something is appended to some list via a callback, make 
the callback stop the reactor.

-- 
  Twisted | Christopher Armstrong: International Man of Twistery
   Radix  |          Release Manager,  Twisted Project
---------+           http://radix.twistedmatrix.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040615/34121008/attachment.pgp 


More information about the Twisted-Python mailing list