Opened 16 months ago

Last modified 16 months ago

#6721 enhancement new

Mention the expectedExceptionTypes argument to failureResultOf

Reported by: tom.prince Owned by:
Priority: normal Milestone:
Component: trial Keywords: documentation policy
Cc: jml Branch:
Author: Launchpad Bug:

Description

In a comment on #6588, exarkun pointed out that

self.failureResultOf(deferred, SomeException)

provides a nicer failure than

failure = failureResultOf(deferred)
self.assertTrue(failure.check(SomeException))

and doesn't suffer from depending on raising an exception from a test as

failure = failureResultOf(deferred)
failure.trap(SomeException)

does.

It seems like the first of these should be the preferred form, so we should document it, and suggest its usage in the trial howto.

Change History (1)

comment:1 Changed 16 months ago by DefaultCC Plugin

  • Cc jml added
Note: See TracTickets for help on using tickets.