[BUG] python -O bzr selftest fails

Robey Pointer robey at lag.net
Mon Oct 31 17:48:44 GMT 2005


On 31 Oct 2005, at 5:53, Aaron Bentley wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robey Pointer wrote:
>
>> It's really two different meanings for assert, as you pointed out
>> yourself later in the thread. :)  One is for validating inputs and
>> assumptions, the other for unit testing.  I definitely agree that   
>> unit
>> tests shouldn't be using raw 'assert'.
>>
>
> They're no good for input validation, since they can be disabled.

Well I think the idea is that in running code out in the wild, you'd  
rather drop the strict checking and keep the server running as much  
as possible -- the asserts are only for debugging.  I'm not sure I  
agree with the idea even for servers, but it seems nonsensical for  
one-shot CLI programs which are going to die soon, error or no.

But since that's how that kind of assertion works, it seems pointless  
to rail against the fact that it's useless for unit tests. ;)

robey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051031/d7b31f44/attachment.pgp 


More information about the bazaar mailing list