|
From: Noel D. <ma...@mc...> - 2009-07-30 17:19:10
|
On Thu, 30 Jul 2009 10:16:15 +0200 troels knak-nielsen <tro...@gm...> wrote: > I wonder what aspect of test cases makes them particularly suitable > for multiple inheritance? I guess it's just that a test case may be asked to do many different things and we don't know in advance what they might be. There's a need to assemble a custom interface (and fixtures) from different groups of components, tailor-made for the task at hand. Marcus wrote: > 1) Fixtures would have a standardised format and become > a kind of plug-in. > 2) setUp() and tearDown() would be pulled directly from the > composed classes leaving the setUp() and tearDown() free. > Also stops the error where you forget to chain these. > 3) __call() is used to inline supplied assertions. > What do you think? Looks good. When I was playing around with this I started off thinking about two separate things: decorators (which add new methods) and fixtures (which are plugged into the setUp/tearDown cycle). Later I decided there's no clear distinction. Fixtures will usually want to decorate as well: probably a new assert method, maybe some accessors so you can make an assertion about a fixture file path or etc. Noel |