[Twisted-Python] Re: [Twisted-commits] r15184 - Initial implementation. Breaks a few tests.

Jonathan Lange jml at mumak.net
Thu Nov 24 18:12:41 MST 2005


On 24/11/05, Jean-Paul Calderone <exarkun at divmod.com> wrote:
> On Wed, 23 Nov 2005 04:52:21 -0700, Jonathan Lange <jml at wolfwood.twistedmatrix.com> wrote:
> >Author: jml
> >Date: Wed Nov 23 04:52:21 2005
> >New Revision: 15184
> >
> >Modified:
> >   branches/jml/trial-deferred-logic/twisted/trial/unittest.py
> >   branches/jml/trial-deferred-logic/twisted/trial/util.py
> >Log:
> >Initial implementation.  Breaks a few tests.
> >
> > [snip]
> >+
> >+    def _eb_setUp(self, failure, result):
> > [snip]
> >+
> >+    def _cb_method(self, ignored, result):
> >+
> > [snip]
> >+
> >+    def _eb_method(self, f, result):
> > [snip]
> >+
> >+    def _eb_tearDown(self, failure, result):
>
> Methods with a contained underscore are reserved for automatic dispatch.  I believe the convention you are looking for here is "_ebSetUp", "_cbMethod", etc.

Initially I agreed, but I've changed my mind.

I want an errback for the method _setUp, not setUp.  If I take
_ebSetUp, then TestCase authors can't use _ebSetUp as an errback for
setUp.  So _eb_setUp seems like the sane choice.

cheers,
jml

PS. Of course, as Itamar suggests, I should perhaps pick a name other
than '_setUp'




More information about the Twisted-Python mailing list