[Twisted-Python] Simple way to halt all timers?

Russell E. Owen rowen at uw.edu
Thu Mar 13 16:51:41 MDT 2014


In article 
<CAE_Hg6YBk6nBrXnMaE0nXyaC4u2WS6RKNVATbcEGDiQGhFJKjQ at mail.gmail.com>,
 Laurens Van Houtven <_ at lvh.io> wrote:

> Hi Russell,
> 
> 
> The way to do this is to pass the reactor as a parameter, and use a Clock
> instead of the regular parameter for unit testing purposes. See also:
> https://twistedmatrix.com/documents/current/core/howto/trial.html ; that
> has a complete example of how to write unit tests that use Clock.
> 
> That way your unit tests will be fast, deterministic, and also very clean
> :-)

Thank you. That looks very promising!

-- Russell





More information about the Twisted-Python mailing list