Brian Kirsch wrote: > I am not sure if we really need the mock reactor. Twisted provides very > good trial test support for creating local loopbacks between
There was recent discussion on twisted mailinglist about trial, and the consensus seems to be that it is broken and you should not use it if you can help it. Search mailinglist for summary line: "Hanging test cases (Was: Evangelism notes...)". Bob Ippolito quote: "Trial is horribly, horribly broken by design and it's really just an accident that it works at all." > Twisted clients and Twisted servers. What is the issue with run and stop > of a reactor? To my knowledge this should not be a problem. I haven't tracked down the exact issues, but when I tried to call run()/stop() more than once in a test program it just did not work. I don't remember the errors, but I could rerun them if you like. Also I seem to recall it was mentioned on twisted mailinglist that you only ever call reactor.run()/stop() once in a program, period. > Also if all the unit tests were running in the same process why would > you need to stop and start the reactor? If that was the case, but the tests should also be runnable standalone, in which case they do need to start and stop the reactor at least once for the module. But it seems like the reactor has a member 'running' so the module could see if the reactor has been started already and adjust it's behavior accordingly. Unfortunately not being able to call run() (which blocks until stop() is called) makes unit testing harder. Which gets us back to the "horribly, horribly broken" trial. -- Heikki Toivonen
signature.asc
Description: OpenPGP digital signature
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Open Source Applications Foundation "Dev" mailing list http://lists.osafoundation.org/mailman/listinfo/dev
