Do they belong to you? Claim these comments.
Stan
Is this you? Claim Profile »
1 year ago
in What are your favorite nose plugins? How do you run Nose? on jessenoller.com comments
Well, all of the indenting was lost, but you get the idea.
1 year ago
in What are your favorite nose plugins? How do you run Nose? on jessenoller.com comments
--pdb-failures is extremely useful for introspecting objects right when a unit test fails. Usually I can figure out what went wrong pretty quick thanks to this.
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...
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...
1 reply
Stan
Well, all of the indenting was lost, but you get the idea.