On 2/6/07, Jonathan Lange <jml@mumak.net> wrote:
On 2/7/07, Allen Bierbaum <abierbaum@gmail.com> wrote:
On 2/6/07, Christopher Armstrong <radix@twistedmatrix.com> wrote:
On 2/6/07, Allen Bierbaum <abierbaum@gmail.com> wrote:
someone has written a plugin for nose that allows it to test twisted code. I don't think it looks as nice as trial, but it should work for the basics. You can see it here: http://python-nose.googlecode.com/svn/trunk/nose/twistedtools.py
UGH
def threaded_reactor():
Yep. Not pretty by any means. :(
I am sure that any suggestions you have to make it better would be well-recieved by the nose project and the plugin's author. :)
I still need to spend some more time looking at nose, but in this particular case I think the plugin is unnecessary.
If your tests subclass twisted.trial.unittest.TestCase, then they should take care of the reactor themselves.[1]
I tried this and things did not work out well. I am currently getting some exceptions inside nose that make me think twisted.trial may have modified the unittest state in a way that it didn't expect. It is always possible though that this is just a side effect of my testing method. Has anyone else tried using trial unittest's directly inside nose? -Allen