[merge] doc how to use new test features

Robert Collins robertc at robertcollins.net
Fri Apr 27 04:11:31 BST 2007


On Thu, 2007-04-26 at 14:53 +1000, Martin Pool wrote:
> Since someone suggested I should use features for my plugins test fix,
> I thought I'd document how to use it.

Cool.

> === modified file 'HACKING'
> --- HACKING	2007-04-24 14:19:24 +0000
> +++ HACKING	2007-04-26 04:50:34 +0000
> @@ -434,6 +434,50 @@
>    __ http://docs.python.org/lib/module-doctest.html
> 
> 
> +
> +Skipping tests and test requirements
> +------------------------------------
> +
> +In our enhancements to unittest we allow for some addition results beyond
> +just success or failure.
> +
> +If a test can't be run, it can say that it's skipped.  This is typically
> +used in parameterized tests - for example if a transport doesn't support
> +setting permissions, we'll skip the tests that relating to that.  Skipped
> +tests are appropriate when there's just no possibility that the test will
> +ever run in this situation, and nothing either developers or users can do
> +about it.  ::

Actually, I disagree with this. Skipping is for things that *can* be
fixed. Things that can't be fixed should not show any output as all as
its just noise.

> +    try:
> +        return self.branch_format.initialize(repo.bzrdir)
> +    except errors.UninitializableFormat:
> +        raise tests.TestSkipped('Uninitializable branch format')

For example the above snippet is clearly fixable: Sit down and write the
code to fix it.

> +Known failures are when a test exists but we know it currently doesn't
> +work, allowing the test suite to still pass.  These should be used with
> +care, we don't want a proliferation of quietly broken tests.  It might be
> +appropriate to use them if you've committed a test for a bug but not the
> +fix for it, or if something works on Unix but not on Windows.

+1 with the skipping thing adjusted - 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/20070427/74d3d617/attachment-0001.pgp 


More information about the bazaar mailing list