Author chris.jerdonek
Recipients Arfrever, Julian, Yaroslav.Halchenko, abingham, bfroehle, borja.ruiz, brett.cannon, brian.curtin, chris.jerdonek, eric.araujo, eric.snow, exarkun, ezio.melotti, fperez, hpk, michael.foord, nchauvat, ncoghlan, pitrou, r.david.murray, santoso.wijaya, serhiy.storchaka, spiv
Date 2013-01-30.18:56:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359572202.29.0.208947599102.issue16997@psf.upfronthosting.co.za>
In-reply-to
Content
> I am concerned that this feature changes the TestResult API in a backwards incompatible way.

My suggestion to add the original TestCase object to TestResult.errors, etc. instead and add the extra failure data to the longDescription would address this concern, which is why I suggested it.  The former is what currently happens with multiple failures per TestCase (e.g. in runTest() and tearDown()).

> The underlying idea of subtests is "if you want to parameterize a test,
here is a useful building block".

The current API doesn't seem like a good building block because it bundles orthogonal features (i.e. to add loop failure data to a block of asserts you have to use the continuance feature).  Why not expose *those* as the building blocks?  The API can be something like--

    with self.addMessage(msg):
        # Add msg to the longDescription of any assertion failure within.
    
    with self.continueTest(msg=''):
        # Keep running the TestCase on any assertion failure within.

(The current subTest() is basically equivalent to continueTest() with a specialized message.  It could be added, too, if desired.)  Accepting a string message is more basic and flexible than allowing only a **kwargs dict, which seems a bit "cute" and specialized to me.
History
Date User Action Args
2013-01-30 18:56:42chris.jerdoneksetrecipients: + chris.jerdonek, brett.cannon, spiv, exarkun, ncoghlan, pitrou, ezio.melotti, eric.araujo, Arfrever, r.david.murray, michael.foord, brian.curtin, hpk, fperez, Yaroslav.Halchenko, santoso.wijaya, nchauvat, Julian, abingham, eric.snow, serhiy.storchaka, borja.ruiz, bfroehle
2013-01-30 18:56:42chris.jerdoneksetmessageid: <1359572202.29.0.208947599102.issue16997@psf.upfronthosting.co.za>
2013-01-30 18:56:42chris.jerdoneklinkissue16997 messages
2013-01-30 18:56:41chris.jerdonekcreate