<html><body>On 05:36 pm, antoine.pitrou@wengo.com wrote:<br /><br />>> More serious than the process-running issue, from my point of view, is<br />>> the fact that if you forget the "@deferred" decorator on a test that<br />>> uses any reactor API, or code that internally _uses_ any reactor API,<br />>> you will put your tests into a non-deterministic state, and although<br />>> they'll pass _most_ of the time, they will die depending on the load<br />>> characteristics of your machine at the time and (insert long-winded<br />>> rant about the evil things threads do to your code here).  Tests are<br />>> exactly the place you never want this to happen :).<br />><br />>That's certainly right, although you should get messages about uncaught<br />>exceptions or unhandled errbacks, so you'll know that something went<br />>wrong.<br /><br />That's not the sort of problem I'm talking about.  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 />>What happens with Trial when you forget to return the Deferred the test<br />>should wait on?<br /><br />Trial doesn't require tests to return Deferreds.  If there is no Deferred, the test completes immediately.<br /><br />>> All in all it seems like it would be simpler to just use trials'<br />>> TestCase class with nose.  Is there any reason not to?<br />><br />>Given that Trial is a self-contained tool, and given that nose also has<br />>its own test running and collecting, I simply didn't expect this to work<br />>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 />>> Trial doesn't force your code to make use of Twisted, and as Mr. Lange<br />>> has declared previously, it goes to some lengths to be compatible with<br />>> stdlib unit tests.<br />><br />>Of course, but to use Trial you must install Twisted don't you ?<br /><br />>Which is quite a big dependency,<br /><br />Is 2 megabytes really too big?<br /><br />>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>