Code review comment for lp:~jelmer/bzr/foreign-tests

Revision history for this message
Martin Pool (mbp) wrote :

2009/9/3 Jelmer Vernooij <email address hidden>:
> On Thu, Aug 13, 2009 at 05:09:06PM -0000, John A Meinel wrote:
>> 3) I would also like to see things like:
>> class ForeignBranchFormatTests(object):
>>   format = None # set by XXXXX
>
>>   def test_foo(self):
>>     self.format.x
>
>> It makes it easier to figure out where things are happening.
>
> This should work well for foreign branch formats. It's trickier though
> in the case of foreign branches, where there is custom code necessary that
> creates a branch. How would the adapter find the code that creates the
> branch attribute that is used by the member methods of a testcase
> class? This seems a lot easier with a MixIn, but I'm probably missing
> something.

I might be missing the point, but I think you'd have

ForeignBranchTests(TestCase):

  branch_factory = None # set by scenario

  def test_log(self):
    branch = self.branch_factory.make_branch_with_crisscross_merges()

--
Martin <http://launchpad.net/~mbp/>

« Back to merge proposal