[MERGE] Re: Don't catch AssertionError

Robey Pointer robey at lag.net
Wed Dec 27 22:03:54 GMT 2006


On 27 Dec 2006, at 0:52, John Arbash Meinel wrote:

> Robey Pointer wrote:
>>
>> On 21 Dec 2006, at 15:08, John Arbash Meinel wrote:
>>
>>> I just wanted to remind everyone that if you find yourself writing a
>>> test that catches AssertionError, it is usually a sign that  
>>> something is
>>> wrong with the code.
>>>
>>> I know of one place where we *have* to. But it is because  
>>> paramiko has
>>> an assert, rather than something we are doing.
>>
>> I just grepped bzrlib for this and I think the assert was in
>> transport/sftp.py, not paramiko, so we can easily avoid doing it.
>> Here's a quick bundle that replaces the (commented-out) assert with a
>> PathNotChild exception, and uncomments the corresponding unit tests.
>> The tests all still pass.
>>
>> robey
>
> Well, you are correct that this can be changed as you say it is.

I forgot to add [MERGE] to the subject last time, to submit to BB, so  
I'm re-posting for that purpose.

robey


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: quickfix-bundle.txt
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20061227/9bd619e5/attachment.txt 


More information about the bazaar mailing list