2 Dec 2005 titus   » (Journeyer)

Review of "Endless Forms Most Beautiful"

A review of "Endless Forms Most Beautiful" by Sean Carroll. (This is a book on evolutionary developmental biology, which is one of the things my lab works on.)

In-process WSGI testing

Reached a stable point with a little side project: wsgi_intercept. This is a broken-out version of my in-process WSGI testing stuff

that works for all of the Python Web testing tools I could find. Specifically, I monkey-patched webtest and webunit; provided a urllib2-compatible handler; and subclassed the mechanoid, mechanize, and zope.testbrowser Browser classes.

I ran into some minor but nonetheless annoying problems along the way. For example, Zope (which is needed for parts of zope.testbrowser) cannot be installed with "easy_install zope"; the PyPi page doesn't link to a download page, and even when downloaded, Zope calls 'setup.py' 'install.py' instead. This confuses easy_install.

I also couldn't figure out contact info for either Zope or CherryPy (the owners of webtest). I didn't look terribly hard, but the PyPi contact e-mail for Zope is a subscriber's-only list, and <team at cherryp.org> (which is the e-mail address at the top of webtest.py) doesn't exist. CherryPy folks -- someone, please contact me if you want the patches to webtest (or just grab them from the wsgi_intercept code yourself, of course!)

And easy_install seems to be confused by packages with '.' in their names; zope.testbrowser doesn't install with just an 'easy_install zope.testbrowser'. (Spoiled, aren't I, to expect it all to work so easily!)

But these are only minor gripes. On the whole, the packages I downloaded and modified had nice, clean source code. I think there's something about people who write testing tools that leads them to clean up their code ;).

A few quick off-the-cuff opinions, while I'm at it:

  • zope.testbrowser is indeed a simple, clean interface to mechanize. (Python2.4 only, however.)

  • I like the way mechanoid (a fork of mechanize) has broken out the class structure of mechanize into files.

  • If I needed a minimal Web testing tool, I'd use webtest.

  • funkload (based on webunit) looks pretty neat. (In the Python world, it's probably the major competitor to twill; they're focusing a bit more on load-testing, though.)

  • people should use ClientCookie rather than urllib2, I think. It does more, and it's written by the same person ;).

  • One of mechanize's big problems is its retention of backwards compatibility. John seems intent on keeping python 2.2 and up working in mechanize; I think that complicates the code more than it should.

Anyhoo, g'nite.

--titus

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!