[MERGE] TestCase.applyDeprecated

Robert Collins robertc at robertcollins.net
Wed Sep 6 00:09:58 BST 2006


On Tue, 2006-09-05 at 18:04 -0500, John Arbash Meinel wrote:
> Robert Collins wrote:
> > This adds a new TestCase helper applyDeprecated. This allows you to call
> > a callable which is deprecated without it spewing to the screen, just by
> > suppling the deprecation format string issued for it.
> > 
> > This is easier to use than callDeprecated in the common case.
> > 
> > CHeers,
> > Rob
> > 
> 


> +1 except for one thing. You have a 'TestCase' object as 'self'.
> Shouldn't you just call 'self.fail()' rather than raising an
> AssertionError? I thought raising AssertionError was bad form.

self.fail raises AssertionError - but yes, brain fart there. I shall
correct it.

> I know we have other tests for deprecated/not deprecated, and I don't
> believe we need to catch AssertionError to do so.

The only catching of AssertError is done to ensure that we're getting a
failure when we want one, in testing this helper.

Cheers,
Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060906/2f6dfa3f/attachment.pgp 


More information about the bazaar mailing list