This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spiv
Recipients Arfrever, Julian, abingham, bfroehle, borja.ruiz, chris.jerdonek, eric.araujo, eric.snow, exarkun, ezio.melotti, flox, fperez, hpk, michael.foord, nchauvat, ncoghlan, pitrou, r.david.murray, santoso.wijaya, serhiy.storchaka, spiv
Date 2013-02-12.01:08:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360631285.3.0.079340620647.issue16997@psf.upfronthosting.co.za>
In-reply-to
Content
googletest (an xUnit style C++ test framework) has an interesting feature: in addition to assertions like ASSERT_EQ(x, y) that stop the test, it has EXPECT_EQ(x, y) etc that will cause the test to fail without causing it to stop.  I think this decoupling of “test failed” and “test execution stopped” is very useful.  (Note this also implies a single test can have multiple failures, or if you prefer that a single test can have multiple messages attached to explain why its state is 'FAILED'.)

I wouldn't like to see a duplication of all assert* methods as expect* methods, but there are alternatives.  A single self.expectThat method that takes a value and a matcher, for instance.

Or you could have a context manager:

with self.continueOnFailure():
    self.assertEqual(x, y)

In fact, I suppose that's more-or-less what the subtests patch offers?  Except the subtests feature seems to want to get involved in knowing about parameters and the like too, which feels weird to me.

Basically, I really don't like the “subtests” name, but if instead it's named something that directly says its only effect is that failures don't abort the test, then I'd be happy.
History
Date User Action Args
2013-02-12 01:08:05spivsetrecipients: + spiv, exarkun, ncoghlan, pitrou, ezio.melotti, eric.araujo, Arfrever, r.david.murray, michael.foord, hpk, flox, fperez, chris.jerdonek, santoso.wijaya, nchauvat, Julian, abingham, eric.snow, serhiy.storchaka, borja.ruiz, bfroehle
2013-02-12 01:08:05spivsetmessageid: <1360631285.3.0.079340620647.issue16997@psf.upfronthosting.co.za>
2013-02-12 01:08:05spivlinkissue16997 messages
2013-02-12 01:08:04spivcreate