[rfc] add a TestFactory class or concept
Robert Collins
robertc at robertcollins.net
Fri Aug 7 08:29:20 BST 2009
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.
I like the sound of improving the test suite (of course):).
One thing to remember is that Launchpad has a history of having a huge
massive database of test data, and I think a global factory of things is
an improvement for them - but we don't have that handicap :).
-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090807/12f11fa0/attachment.pgp
More information about the bazaar
mailing list