[TIP] unit testing wxPython wrapper objects.

Nate Lowrie solodex2151 at gmail.com
Thu Mar 8 21:01:19 PST 2007

On 3/9/07, Titus Brown <titus at caltech.edu> wrote:
> On Thu, Mar 08, 2007 at 02:54:20PM -0700, Nate Lowrie wrote:
> -> Ok, normally I just run acceptance tests with the GUIs because they
> -> are too costly to write unit tests for.  However, in this instance,
> -> half of the framework that I am testing is actually a wrapper for
> -> wxPython.
> ->
> -> Would you suggest mocking wx so I can verify an UI widget without
> -> having to go through the process of starting an app, blah..., blah...,
> -> blah...?  Everything that could be pushed out to mixins has and those
> -> test fine because they don't subclass anything wx, but there is still
> -> several thousand lines of code in classes that subclass wx.
> ->
> -> Any help would be appreciated.  I would like to avoid using wx for
> -> unit tests to avoid slow test smells if at all possible.
> Have you seen this?
> http://wiki.wxpython.org/index.cgi/Unit_Testing_with_wxPython
> There has been some general discussion on wx unit testing on some blog
> somewhere, but this is the best link I can find.
> Ahh, here's what I was thinking of:
>         http://dirtsimple.org/2004/12/mocking-wxpython.html
>         http://yergler.net/blog/2005/04/14/a-plan-for-gui-testing/
> Oh well, perhaps not that useful but at least relevant.

Thanks.  They are all useful.  I will probably use them in acceptance
testing, but since Dabo only wraps wx and is not a unit test, I am
finding mocking to be more useful.  I will probably post a writeup of
what I found.


Nate L.

> HTH,
> --titus

More information about the testing-in-python mailing list