Don't catch AssertionError

Robey Pointer robey at lag.net
Wed Dec 27 00:56:56 GMT 2006


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


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


More information about the bazaar mailing list