[Dev] Mock Reactor for tests?

Heikki Toivonen heikki at osafoundation.org
Tue Jun 7 11:12:10 PDT 2005


Phillip J. Eby wrote:
> I've also investigated the run()/stop() issue, and as far as I can tell
> this should be a non-issue for tests that run using the Twisted default
> reactor (which is what Chandler uses).  The reason that you aren't

That's strange, because I was testing with default reactor in a command
line test app. I just retested and the symptoms are that the (unit test)
program ends up in infinite loop where it gives timeout errors every now
and then, and does not respond to Ctrl+C. This is under Cygwin.

> reactor.waitFor(deferred, timeout) -- iterate until the deferred

Since I haven't needed to use deferred's in my trivial test cases I'd
need to figure out how to call this.

> Heikki, does that sound about like what you need for your tests?

>From the API description it looks like it would do what I need, with the
caveat that I need to figure out how to deal with deferreds.

But I think it should go into twisted proper. I have a need for this in
M2Crypto unit tests, Grant could probably use this for zanshin unit
tests etc.

--
  Heikki Toivonen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.osafoundation.org/pipermail/dev/attachments/20050607/584bd285/signature.pgp


More information about the Dev mailing list