[MERGE] TestCase.expectFailure

Aaron Bentley aaron.bentley at utoronto.ca
Wed Apr 4 00:48:54 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

This patch builds on Robert's recent test suite work.  (Thanks Robert!).
 It implements a convenience method for handling known failures.  It
allows you to use any of the assertFoo methods.  If the assertion fails,
it raises KnownFailure, otherwise, it raises an AssertionError.

It may seem surprising that we should *fail* when an assertion passes.
I have two situations in mind:

1. We have fixed the underlying cause of the failure.  In this case, we
should clean up all the expectedFailures, to ensure that the fix does
not regress.  If we are noisily reminded about every site, we can't
accidentally leave some expectedFailures in place.

2. The test starts passing unexpectedly.  In this case, there may very
well be something wrong.  An unexpected success is really just as bad as
an unexpected failure.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGEufm0F+nu1YWqI0RAh58AJ9n+EemmD3z/SstSMF8kkIuXx0lOACfYcSw
YIWbyFgQO1TjQhYfMwkgP7Q=
=XQVf
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: expect-failure.patch
Type: text/x-patch
Size: 3931 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070403/db37ccfb/attachment.bin 


More information about the bazaar mailing list