Author ezio.melotti
Recipients bennoleslie, ezio.melotti, michael.foord, rbcollins
Date 2015-12-31.00:26:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This happens because (Lib/unittest/ runs setUp/test/tearDown in 3 separate testPartExecutor context manager  (Lib/unittest/  testPartExecutor appends any error to self.errors (Lib/unittest/ and simply reports the total number of errors Lib/unittest/
If an error happens in the setUp, the test and tearDown are not executed, but if it happens in the test, the tearDown is still executed, possibly appending a second error to self.errors.

I don't see any easy way to fix this, since both errors should stay in self.errors and be reported, so removing one is not an option.  Trying to determine if 2 errors are related to a single test/tearDown pair in the TestRunner might be possible, but probably not worth it.

Adding a sentence to the doc and possibly a comment in to document this corner case is probably enough.
Date User Action Args
2015-12-31 00:26:33ezio.melottisetrecipients: + ezio.melotti, rbcollins, michael.foord, bennoleslie
2015-12-31 00:26:33ezio.melottisetmessageid: <>
2015-12-31 00:26:33ezio.melottilinkissue25687 messages
2015-12-31 00:26:32ezio.melotticreate