[TIP] Boolean testing frameworks?

Chris Withers chris at simplistix.co.uk
Tue Mar 14 04:08:54 PDT 2017


On 14/03/2017 07:51, Robert Gomułka wrote:
> Hi all,
> some time ago (years?) I saw a testing framework allowing combining
> test oracles with boolean expressions.
> It was more or less like:
>
>>>> self.and(self.eq(a, 1), self.eq(b, 2))
>
>>>> self.or(self.eq(a, 3), self.ne(b, 3))
>
>>>> self.or(self.and(..., ...), self.eq(...))

What's wrong with just:

assert a==1 and b==2
assert a==3 or b!=3
assert (... and ...) or ...=...

This doesn't smell very good from a testing perspective, why are your 
tests to decomposable into individual cases?

cheers,

Chris



More information about the testing-in-python mailing list