[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch and the attempt, Tim! -- Added file: http://bugs.python.org/file13395/unnamed ___ Python tracker ___Thanks for the patch and

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Benjamin Peterson
Benjamin Peterson added the comment: I concur with other developers. In strict unittesting, assertions of correct behavior should only ever happen in the test not during set up or tear down. -- nosy: +benjamin.peterson resolution: -> rejected status: open -> closed ___

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Tim Cuthbertson
Tim Cuthbertson added the comment: In my mind, an error means something is wrong. A failure just means a test case hasn't been implemented yet, or has regressed. For me it's misleading to have an AssertionError reported as a failure. It's not as if changing the reporting in this way could cause

[issue5531] unittest: allow failures in tearDown method

2009-03-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: Agreed with Brett and Raymond. Besides, I'm not sure how getting a failure rather an error changes anything in the big picture (for my non native English-speaking brain, it certainly doesn't make a difference :-)). -- nosy: +pitrou

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson
Tim Cuthbertson added the comment: I agree that this is not normally the point of tearDown methods. However, allowing it reduces repetition when you want to verify that some invariant is not violated by any test. I also think that as far as the test writer is concerned, an assertion error is a

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Brett. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Brett Cannon
Brett Cannon added the comment: So I disagree with this idea. The point of a tearDown method is simply to clean up, not to test for a failure. If the test failed because it didn't complete a test and clean up after itself then the test should fail explicitly, not have the tearDown do it for the

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson
Tim Cuthbertson added the comment: updated patch: made the test method name unique (oops), and added the specific test case where both test body and tearDown raise failure exceptions. This patch supercedes the original (v0) -- Added file: http://bugs.python.org/file13388/unittest-fail-o

[issue5531] unittest: allow failures in tearDown method

2009-03-21 Thread Tim Cuthbertson
New submission from Tim Cuthbertson : This patch adds the behaviour that when a unittest.failureException is thrown in a TestCase's tearDown method, the test case is added to the failures list (instead of the errors list, and only when the test case body has passed successfully). In some circums