[qmtest] writing composite tests
Nathaniel Smith
njs at pobox.com
Mon Sep 8 22:43:37 UTC 2003
On Mon, Sep 08, 2003 at 02:59:40PM -0400, Stefan Seefeld wrote:
> Mark Mitchell wrote:
>
> >But, why do you have to change the Run interface? The Run method in the
> >composite class could simply pass its result parameter down to the
> >contained test classes. Wouldn't that work?
>
> yes, sure. Then I'd write
>
> def Run(self, context, result):
> self.a.Run(context, result)
>
> if result.GetOutcome() == result.FAIL:
> return
>
> self.b.Run(context, result)
>
>
> which is a bit more verbose than just
>
> def Run(self, context, result):
> return self.a.Run(context, result) and self.b.Run(context, result)
But you really want something more complicated anyway, because you
want to merge all the "sub-results" -- just throwing out all the
annotations is no good! So I don't know that changing things
like this buys you much. For that matter, this wouldn't even work
for just getting the right outcome; there are four possible outcomes
to consider, and a boolean only allows for two.
(Yes, the sig quote is randomly chosen.)
-- Nathaniel
--
So let us espouse a less contested notion of truth and falsehood, even
if it is philosophically debatable (if we listen to philosophers, we
must debate everything, and there would be no end to the discussion).
-- Serendipities, Umberto Eco
More information about the qmtest
mailing list