testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00618
Re: [Merge] lp:~allenap/testtools/lessthan-mismatch-string into lp:testtools
> The output that was printed is clearly bong (and thats a bug). It
> should say '<'. 'not >' would be wrong, because == is permitted.
The matcher is LessThan, so == should not be permitted.
The other _BinaryComparison subclasses describe the failed state. Spot
the odd one out below:
>>> matchers.Equals(1).match(2).describe()
'1 != 2'
>>> matchers.NotEquals(1).match(1).describe()
'1 == 1'
>>> matchers.Is(1).match(2).describe()
'1 is not 2'
>>> matchers.LessThan(1).match(2).describe()
'1 is >= 2'
If the arguments appear in the mismatch message in the same order as
Equals, NotEquals and Is - namely expected followed by observed - then
the LessThan mismatch message should say either:
>>> matchers.LessThan(1).match(2).describe()
'1 is <= 2'
or:
>>> matchers.LessThan(1).match(2).describe()
'1 is not > 2'
However, a better description might be:
>>> matchers.LessThan(1).match(2).describe()
'2 is not < 1'
or even:
>>> matchers.LessThan(1).match(2).describe()
'2 is not less than 1'
--
https://code.launchpad.net/~allenap/testtools/lessthan-mismatch-string/+merge/57323
Your team testtools developers is requested to review the proposed merge of lp:~allenap/testtools/lessthan-mismatch-string into lp:testtools.
References