[Twisted-Python] using py.test with twisted

Ralf Schmitt ralf at brainbot.com
Sun Feb 18 11:14:49 EST 2007


there's been a discussion about using the nose unittest system together 
with twisted.trial.
I'm attaching a short script which enables the py.test system 
to execute unittests which use twisted (it's not compatible with trial, 
instead you have to write your
unittests like you would in py.test.). It uses greenlets in order to 
integrate twisted's mainloop with py.test.
This method might also be applicable with nose (and might be a better 
hack than the threaded_reactor hack).

Tested with a recent twisted trunk and py-0.9.0.Note that the setup and 
teardown methods currently can't return deferreds.

- Ralf

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: py.test.twisted
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070218/9109359d/attachment.txt 

More information about the Twisted-Python mailing list