Gregor Lingl wrote:
> Yes,, and I have some ideas in this respect, but mainly a prioncipal 
> question. I read about
> using doctest and unittest, but how does one devise
> automatic test suites for graphical output. In the end it depends on how 
> it looks like.

There are a few options here..  Two that come to mind are:

   - Check the output -- e.g., run a demo, and then use Tkinter.Canvas to
     write its output to postscript, and then check the contents of that
     postscript file against a known correct file.

   - Monkey-patching -- replace specific classes (e.g.,  ScrolledCanvas?)
     with new testing classes that simply intercept drawing primitives,
     rather than displaying graphics.  Then check that the right drawing
     primitives (lines, circles, etc) are generated in the right order.

The former may be more robust, but requires that you have a display 
surface available.  With the former approach, you may also run into some 
problems with different postscript files being generated on different 
systems (esp. with respect to font sizes -- I seem to remember that 
using negative font sizes might help there?).

-Edward
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to