Test clarification

Kevin Smith yarcs at qualitycode.com
Thu Dec 1 18:57:00 GMT 2005


John A Meinel wrote:
> I just wanted to try and get a consistent use of:
> 
> self.assertEquals(a, b)
> 
> Should a or b be the "expected" value.

Hm. I'm not a python guy. In both java and ruby, a would be the 
"expected" value, and b would be the "actual". But based on a quick web 
search, it look like the python community has adopted opposite 
positions. Odd.

Regardless, I would have thought that any failure messages would clearly 
show which way the test framework is set up:

    Failure: expected "blah" but was "foo"

I strongly agree that within any single project, there should be One 
Right Way(tm), and it should always be used.

Kevin




More information about the bazaar mailing list