[Twisted-Python] using py.test with twisted

Ralf Schmitt ralf at brainbot.com
Sun Feb 18 09:14:49 MST 2007


Hi,

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 
(http://codespeak.net/py/dist/test.html)
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: </pipermail/twisted-python/attachments/20070218/9109359d/attachment.ksh>


More information about the Twisted-Python mailing list