David James wrote:
> On 6/6/06, email@example.com <firstname.lastname@example.org> wrote:
>> Remove Python-2.4-isms from the Python bindings testsuite -
>> use unittest.TestCase.assert_(), not unittest.TestCase.assertTrue().
> Hey Max,
> Thanks for fixing this! However, I'm not sure this is the right fix.
> Instead of replacing 'assertTrue' with 'assert_', could we just write
> a compatibility wrapper function called 'assertTrue', which delegates
> to either assert_ or assertEqual(x, true)? assertTrue is a much better
> name for the function than 'assert_'.
I think assert_ is a good, if odd, name - it's clearly expressing its
congruency with the eponymous keyword, whilst doing a minimal workaround
for the fact that assert is a keyword.
We could trivially make assertTrue available on earlier Python versions:
unittest.TestCase.assertTrue = unittest.TestCase.assert_
... but I'm not sure we should, when there is a fully compatible
equivalent, and assertTrue is actually _undocumented_ at present.
Received on Tue Jun 6 19:33:53 2006