[Zope3-dev] Re: Windows eggs
Wichert Akkerman
wichert at wiggy.net
Sat Jul 14 13:00:01 EDT 2007
Previously Marius Gedminas wrote:
> - Unit tests: there are many of those, they're independent (thus a
> single .txt for a collection of tests is a Bad Idea), they're short
> (so understanding and debugging is easy) and expressive. I put
> those into .py files full with functions that look like
>
> def doctest_FooClass_does_this():
> """Test that FooClass is able to ...
>
> >>> foo = FooClass()
> >>> results = foo.do_this()
> >>> for fruit, score, comments in results:
> ... print fruit.ljust(10), '|', score.ljust(5), '|', comments
> Orange | 9 | Tastes good, a bit sour
> Apple | 8 | Varies
>
> """
>
> and have a traditional test_suite() function at the end that returns
> a DocTestSuite with the appropriate setUp/tearDown/optionflags.
Until you have to step through the test with pdb, at which point it
becomes very painful.
Wichert.
--
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the Zope3-dev
mailing list