[MERGE] fix formatting of ImmortalPendingDeletion error message.

Robert Collins robertc at robertcollins.net
Tue Nov 13 20:46:13 GMT 2007


On Tue, 2007-11-13 at 13:05 +0200, Alexander Belchenko wrote:
> Today I ran 'bzr up' in bound branch and got unprintable exception error:
> ..

> So I'm writing test and fix for this case.

bb:resubmit

Your patch's new helper function is interesting, but it seems a lot
harder than just using the current pattern for testing formatting of
errors:
 - e = SomeError(params)
 - self.assertEqual(expected_string, str(e))

So I'd prefer you just did that.

About the helper in more detail.. it seems more useful when one is not
routinely testing the way exceptions are formatted (which we do), and do
not have a modified assertRaises which returns the exception (which we
do).

In bzr if you needed to check the formatting today you can already do

 e = self.assertRaises(Error, thingthaterrors)
 self.assertEqual("foo", str(e))

which seems a whole lot simpler than this Ned's function to me. (And in
fact the helper you cloned really should be only 2 lines long if we were
to accept it). But I don't see a need for it.

As a meta-comment, this is a case where I'd consider uncommit+commit,
because the history of the patch is fairly uninteresting for mainline
and there seems to be low risk of anyone having merged it into a branch.

-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: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071114/6b6c4942/attachment.pgp 


More information about the bazaar mailing list