-
Website
http://www.jessenoller.com/ -
Original page
http://jessenoller.com/2008/05/13/what-are-your-favorite-nose-plugins-how-do-you-run-nose/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
jackdied
4 comments · 1 points
-
dougnapoleone
3 comments · 3 points
-
Michael Foord
6 comments · 7 points
-
llimllib
7 comments · 2 points
-
Doug Hellmann
4 comments · 3 points
-
-
Popular Threads
-
I want your awesome python snippets.
5 days ago · 8 comments
-
Python’s Moratorium – Let’s think about this.
2 weeks ago · 25 comments
-
I want your awesome python snippets.
I also use nose to drive twill-based website unit tests:
(not sure how well this will paste)
# test.py
import twill, glob
from StringIO import StringIO
from nose import with_setup
def setup():
outp = StringIO()
twill.set_output(outp)
def run_twill(twill_file):
script = file(twill_file).read()
twill.execute_string('reset_browser')
twill.execute_string(script)
@with_setup(setup)
def test_twill():
for filename in glob.glob('*.twill'):
yield run_twill, filename
### EOF
Now you can put all of your website tests into .twill files in the current directory. I suppose this could be made into a nose plugin...
Test generators are pretty key us. The same feature is in py.test - we use that feature of nose constantly on our team here @ work.
The plugin architecture has also allowed us to be more flexible in what we can pass to our functional tests. We build custom plugins to allow more flexible test collection and execution.
The underlying system of test collection is what has always attracted me. nose, in general, allows me to very quickly put together a suite of tests without have to deal with UnitTest boilerplate.
I also miss nosetty, a plugin I wrote a while ago for 0.9 but have yet to port it to 0.10. Quite a lot has changed in stream handling and I started the migration but didn't finish. It was nice because it let you launch an editor at the exact spot in a traceback, especially nice if you need to apply a quick, experimental patch to a system egg.
I also use NoseGAE for testing Google App Engine webapps in-process: http://code.google.com/p/nose-gae/
btw, the official (unofficial?) list of all nose plugins is here: http://nose-plugins.jottit.com/
http://www.assembla.com/wiki/show/nose_notify