[TIP] Testing the Fixture?

Titus Brown titus at caltech.edu
Wed Nov 21 22:00:10 PST 2007


-> > I, however, would argue that this is a bad idea: tests should fail or
-> > they should succeed.  Having code that relies on local code trickiness
-> > to ignore or halt successive tests seems like a fantastic way to lose
-> > test code.
-> 
-> Ok, I'll take your advice on that then. However, I'm getting a hang from
-> nose when I make it fail in the module setup. I get the output that it
-> failed on 0 tests, but then nose won't exit. Any idea what the below
-> should be instead?

CherryPy is Evil.  Its threading is causing your problems.

Meet my leetle friend, wsgi_intercept:

	http://ivory.idyll.org/articles/twill-and-wsgi_intercept.html

Incidentally, the maintainer of wsgi_intercept is a fella named Kumar
McMillan, who is also on this list.

cheers,
--titus

-> # use module level setup/teardown to start/stop server
-> # by starting the server anew, we clear all session vars
-> def setup():
->     print "module level setup()"
->     # fire up the server
->     cherrypy.root = Root()
->     cherrypy.config.update( test_config )
->     cherrypy.server.start( initOnly=True )



More information about the testing-in-python mailing list