[MERGE] TestCase.expectFailure

Martin Pool mbp at canonical.com
Wed Apr 4 00:56:51 BST 2007


Martin Pool has voted +1 (conditional).
Status is now: Conditionally approved
Comment:
+    def expectFailure(self, reason, test, *args, **kwargs):
+        """Invoke a test, expecting it to fail for the given reason.
+
+        Intended to be used with a callable that raises AssertionError 
as the
+        test.  args and kwargs are passed to the test.
+
+        Raises KnownFailure if the test fails.  Raises AssertionError 
if the
+        test succeeds.
+

I would expect that a parameter called 'test' took a test object.  The 
example makes it clear that you're actually meant to pass a callable 
assertion.  You could also add a note in this docstring that this is for 
things that _should_ pass, but that are not fixed yet, as opposed to 
assertRaises where it really _should_ fail.

For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3C4612E7E6.7040603%40utoronto.ca%3E



More information about the bazaar mailing list