What unit-test tools are recommended for testing GUI apps on windows?
Are there any better-suited for wx apps?
In my experience, the unittest module included with the Python
standard library works just fine. The important part of unittesting
GUI applications is not to start the main loop, but you don't need a
specific tool for that.
Cheers, Frank
···
2009/11/22 cappy2112 <cappy2112@gmail.com>:
What unit-test tools are recommended for testing GUI apps on windows?
Are there any better-suited for wx apps?
Thanks Frank, that is an interesting idea.
If you don't start the main loop, how can you test the users input,
menu accesses, mouse clicks, etc?
These actions all cause event handlers to be called. Testing the event
generation/handling code is important too.
···
In my experience, the unittest module included with the Python
standard library works just fine. The important part of unittesting
GUI applications is not to start the main loop, but you don't need a
specific tool for that.Cheers, Frank
In my experience testing that a button actually invokes its event
handler is not worth the effort. In our tests (for Task Coach, an open
source task manager developed in python and wxPython) we simply invoke
the event handler with a dummy event if needed.
See this article:
http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf
Cheers, Frank
···
2009/11/22 cappy2112 <cappy2112@gmail.com>:
Thanks Frank, that is an interesting idea.
If you don't start the main loop, how can you test the users input,
menu accesses, mouse clicks, etc?
These actions all cause event handlers to be called. Testing the event
generation/handling code is important too.
Frank Niessink wrote:
Thanks Frank, that is an interesting idea.
If you don't start the main loop, how can you test the users input,
menu accesses, mouse clicks, etc?
These actions all cause event handlers to be called. Testing the event
generation/handling code is important too.
In my experience testing that a button actually invokes its event
handler is not worth the effort. In our tests (for Task Coach, an open
source task manager developed in python and wxPython) we simply invoke
the event handler with a dummy event if needed.See this article:
Vacation Rental HacksCheers, Frank
>
I've been using this "fakewidgets" package, see -
http://ginstrom.com/code/fakewidgets.html
It overrides the wx namespace, so when you load in your classes they're
loading in the fake, dummy widgets.
I also modified the original fakewidgets to add classes my program used
-- can be viewed at
http://bazaar.launchpad.net/~sproaty/whyteboard/development/files/head%3A/fakewidgets/