W3C home > Mailing lists > Public > public-cwm-talk@w3.org > October to December 2005

Re: Off topic: Python unit testing tools

From: Graham Klyne <GK@ninebynine.org>
Date: Sun, 23 Oct 2005 10:34:00 +0100
Message-ID: <435B5908.4000805@ninebynine.org>
To: Dan Connolly <connolly@w3.org>
CC: public-cwm-talk@w3.org

Dan Connolly wrote:
> On Sat, 2005-10-22 at 11:01 +0100, Graham Klyne wrote:
>>[...] any Python
>>equivalents to Mock object, XMLUnit and HTTPUnit libraries available in
> I'm not sure what those are.

  http://xmlunit.sourceforge.net/  (I just noticed
http://opensource.thoughtworks.com/projects/xmlunit.jsp - apparently
someone's working on a PyUnit port)

Basically they're all providing JUnit bolt-on modules of various kinds
to ease the writing of test cases.

Currently, its a Python version of XMLUnit I'm after, which makes it
easy to write tests that looks for particular properties in XML files
(e.g. abstracting away XML-equivalents like <a></a> == <a/> and order of
attributes, and allowing to look for particular XML-fragment values
selected using Xpath and/or XSLT expressions).

> There is of course pyunit
> http://pyunit.sourceforge.net/
> I gather it's "batteries included"... yes...
> http://docs.python.org/lib/module-unittest.html

Yes, I've been using that, on-and-off, for a while.

> I use doctest pretty regularly.
> http://docs.python.org/lib/module-doctest.html

Cool!  I'd overlooked that.  I see that being excellent for what I might
call "micro-unit" testing.

> On the chance that HTTPunit is what I think it is,
> I think the equivalent is:
>  Website unit/regression testing tool
>  http://mechanicalcat.net/tech/webunit/

Yes, excellent, thanks!   My search didn't uncover that.

>  <- http://wwwsearch.sourceforge.net/mechanize/
>  <- http://del.icio.us/connolly/testing+python

That leads me to
which looks like a useful resource.  Thanks again.


Anyway, pulling together these various strands, I've started a wiki page at:


Graham Klyne
For email:
Received on Sunday, 23 October 2005 10:13:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:01:04 UTC