[rfc] add a TestFactory class or concept
Michael Hudson
michael.hudson at canonical.com
Sat Aug 8 12:37:01 BST 2009
Robert Collins wrote:
> On Thu, 2009-08-06 at 18:12 +1000, Martin Pool wrote:
>> Lots of tests are run on some specific values; for instance they make
>> a branch and then do some operations on it.
>>
>> I was talking to jml the other day and he said that Launchpad have a
>> cleaner separation of all of this setup into a TestFactory class
>> (iirc) - if you want a Person to test, you would always get that from
>> the factory rather than putting arbitrary example data into the class.
>
> I don't really like the sound of this. I was looking at a test just the
> other day that has its specific data elsewhere, and its really hard to
> read. I'd rather focus on making it very pithy to put specific data
> in-line.
That's what the factory does for us in Launchpad; for example every
Person has a name, but if you use the factory, you only have to specify
the name if you care about it.
I'm not sure Bazaar has so much of this sort of thing.
Cheers,
mwh
More information about the bazaar
mailing list