<html><body>On 05:36 pm, antoine.pitrou@wengo.com wrote:<br /><br />&gt;&gt; More serious than the process-running issue, from my point of view, is<br />&gt;&gt; the fact that if you forget the "@deferred" decorator on a test that<br />&gt;&gt; uses any reactor API, or code that internally _uses_ any reactor API,<br />&gt;&gt; you will put your tests into a non-deterministic state, and although<br />&gt;&gt; they'll pass _most_ of the time, they will die depending on the load<br />&gt;&gt; characteristics of your machine at the time and (insert long-winded<br />&gt;&gt; rant about the evil things threads do to your code here). &#160;Tests are<br />&gt;&gt; exactly the place you never want this to happen :).<br />&gt;<br />&gt;That's certainly right, although you should get messages about uncaught<br />&gt;exceptions or unhandled errbacks, so you'll know that something went<br />&gt;wrong.<br /><br />That's not the sort of problem I'm talking about. &#160;Some reactor APIs will appear to work when called from the wrong thread, so if you forget a @deferred somewhere, your test might seem to work, or hang in a weird place, or produce different error output each time.<br /><br />&gt;What happens with Trial when you forget to return the Deferred the test<br />&gt;should wait on?<br /><br />Trial doesn't require tests to return Deferreds. &#160;If there is no Deferred, the test completes immediately.<br /><br />&gt;&gt; All in all it seems like it would be simpler to just use trials'<br />&gt;&gt; TestCase class with nose. &#160;Is there any reason not to?<br />&gt;<br />&gt;Given that Trial is a self-contained tool, and given that nose also has<br />&gt;its own test running and collecting, I simply didn't expect this to work<br />&gt;or to keep working accross versions of both tools.<br /><br />This is definitely a concern, but your current approach doesn't seem any less fragile.<br /><br />&gt;&gt; Trial doesn't force your code to make use of Twisted, and as Mr. Lange<br />&gt;&gt; has declared previously, it goes to some lengths to be compatible with<br />&gt;&gt; stdlib unit tests.<br />&gt;<br />&gt;Of course, but to use Trial you must install Twisted don't you ?<br /><br />&gt;Which is quite a big dependency,<br /><br />Is 2 megabytes really too big?<br /><br />&gt;and Twisted does not yet support being easy_install'ed.<br /><br />... and nose doesn't yet support being apt-get installed ;-)<br /><br />If you'd like to see easy_install support for Twisted, please feel free to contribute support for it; the release manager could probably use some help maintaining setup.py in general.<br /></body></html>