[patch] new merge tests suggested by Aaron

John Arbash Meinel john at arbash-meinel.com
Wed Dec 21 16:24:49 GMT 2005


duchier at ps.uni-sb.de wrote:
> John Arbash Meinel <john at arbash-meinel.com> writes:
> 
> 
>>I think you got the diff backwards :)
> 
> 
> rats! non-commuting arguments...
> 
> 
>>I have to reverse my request. I thought they came with more description
>>about the operation, not just a set of shell commands.
> 
> 
> they did: that's what got trimmed down to produce the first line.  do
> you want that back?

The idea is that you have a 1 line summary, and then some more verbose
text explaining it.
If the 1 line summary is sufficent, there may be no need for the rest.

> 
> 
>>Would it be okay if I just change the name of the test? So you have:
>>
>>   def test_rename_before_create(self):
> 
> 
> Yes.  I should have thought of that myself.
> 
> 
>>Though I might leave a single comment line in for:
>>
>>   def test_create_before_rename(self):
>>	# create before rename, target parents before children
> 
> 
> So you mean to rename the tests and then drop the docstring
> altogether?

Well, there is a current discussion about docstrings versus comments in
tests. Specifically there was a decision that in 'bzr selftest
--verbose' mode, the first line of the docstring is printed if
available, otherwise the function path
(tests.test_commit.CommitTest.test_foo) is printed.

I've found that I pretty much always prefer to see the path, because
then I can figure out what test failed/succeeded, rather than seeing the
description. So I tend to write tests as:

def test_this(self):
    # This would be a docstring if we were using docstrings.

I don't want the test name to have the full comment, though, because I
don't really want to see:

def test_rename_to_temp_before_delete_source_children_before_parents(self):

So I would do something more like:
def test_rename_to_temp_before_delete(self):
    #rename to temp before delete, source children before parents

> 
> --Denys

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051221/ca45a84c/attachment.pgp 


More information about the bazaar mailing list