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 ncoghlan
Recipients hpk, michael.foord, ncoghlan, r.david.murray
Date 2011-09-18.23:34:59
SpamBayes Score 6.1062266e-16
Marked as misclassified No
Message-id <1316388900.51.0.0427929293823.issue10548@psf.upfronthosting.co.za>
In-reply-to
Content
As another data point, this question came up again in the context of issue #12958.

The new test_socket.ThreadableTest uses tearDown() to pick up and reraise any exception that occurred in the client thread. This meant that my initial attempts at flagging some expected failures (due to Mac OS X limitations) didn't work - the client half of the failure was thrown in tearDown() and reported as an error.

While I've determined how to avoid that problem in the test_socket case, the general question of whether or not we consider it legitimate to put common assertions in setUp() and tearDown(), or expect that test code explicitly cope with tearDown() failures that occur due to expected test failures still needs to be addressed.

To my mind, bugs in my test infrastructure are going to get flushed out by tests that I'm neither skipping nor marking as expected failures. If I have a test that is known to fail in a way that invalidates the standard tearDown procedure for the test infrastructure, having to special case that situation in the tearDown code seems to go against the spirit of offering the "expectedFailure" decorator in the first place.

I don't think the same reasoning holds for setUp though - there's no way for a failing test to reach back and force setUp to fail, so any errors raised there are always going to be infrastructure errors.
History
Date User Action Args
2011-09-18 23:35:00ncoghlansetrecipients: + ncoghlan, r.david.murray, michael.foord, hpk
2011-09-18 23:35:00ncoghlansetmessageid: <1316388900.51.0.0427929293823.issue10548@psf.upfronthosting.co.za>
2011-09-18 23:34:59ncoghlanlinkissue10548 messages
2011-09-18 23:34:59ncoghlancreate