[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r19962 - trunk/subversion/bindings/swig/python/tests

From: David James <djames_at_collab.net>
Date: 2006-06-06 19:37:53 CEST

On 6/6/06, Max Bowsher <maxb1@ukf.net> wrote:
> David James wrote:
> > 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:
>
> try:
> unittest.TestCase.assertTrue
> except AttributeError:
> 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.

Ah, OK. I thought that 'assertTrue' was documented whereas 'assert_'
is not, but, after looking into this more thoroughly, I realise I was
mistaken.

Thanks for the explanation, Max.

Cheers,

David

-- 
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 6 19:38:17 2006

This is an archived mail posted to the Subversion Dev mailing list.