Test clarification

Robert Collins robertc at robertcollins.net
Thu Dec 1 21:32:32 GMT 2005


On Thu, 2005-12-01 at 08:10 -0600, 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.
> 
> For example, should the test be written:
> 
> a = somecommand()
> self.assertEquals(a, 'this text')
> 
> or
> 
> a = somecommand()
> self.assertEquals('this text', a)
> 
> 
> The former makes a little bit more sense in a "assert a equals b". Which
> has the feeling that a should be the one doing the equaling.
> 
> It would be nice if tests were consistent about it, though. So when you
> look at the errors, you know which one is incorrect.

I tend to use (expected, actual). If we have a standard, it would be
nice to use that ;).

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051202/b091e35b/attachment.pgp 


More information about the bazaar mailing list