[MERGE] don't report malformed bundles as NotABundle
John Arbash Meinel
john at arbash-meinel.com
Wed Jun 21 20:49:22 BST 2006
Aaron Bentley wrote:
> Aaron Bentley wrote:
>
>>> That is deliberate. This test explicitly permits it read_bundle to
>>> raise any exception it wishes, except BadBundle. That is all I care
>>> about. That is specifically what I want to test.
>
> Oops, I meant NotABundle. In case it's not clear why I'm harping on
> NotABundle, it's because NotABundle causes merge and pull to treat the
> path as a branch.
>
> Aaron
I do understand why you are checking against NotABundle.
My concern is just that assertNotRaises isn't a very good test function.
Because it basically hides errors. In general when testing failure
modes, we want to make sure we fail in the way we expect. If we start
failing in a different way, then we should know about it, and possibly
just fix the test case.
I think doing an inline try/except where you explicitly fail if it is
NotABundle, succeed if it is a subclass of BadBundle, and otherwise
fail. And then add a comment to the BadBundle part, making an explicit
note that "It is important that NotABundle not be raised, but the
exception may not be BadBundle", or something like that.
Grabbing any exception also breaks 'KeyboardInterrupt', which we don't
want to grab.
I do understand what you are trying to do, and I think it is a
reasonable test. But I don't think it is satisfied by catching and
quietly throwing away any exception.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060621/9a9f55bb/attachment.pgp
More information about the bazaar
mailing list