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.

classification
Title: addSubtest not calling addFailure and addError
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.9
process
Status: closed Resolution: duplicate
Dependencies: Superseder: unittest subTest does not call addFailure
View: 29152
Assigned To: Nosy List: Xavier Dollé, ezio.melotti, michael.foord, rbcollins, xtreak
Priority: normal Keywords:

Created on 2019-07-30 09:46 by Xavier Dollé, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg348728 - (view) Author: Xavier Dollé (Xavier Dollé) Date: 2019-07-30 09:46
addSubTest from TestResult is appending elements to failures and errors without using addFailure or addError, making the extend of this class more difficult.

suggestion:

def addSubTest(self, test, subtest, err):
...
    if issubclass(err[0], test.failureException):
        self.addFailure(subtest, err)
    else:
        self.addError(subtest, err)

The suggested change would make it more concise and easier to extend.
msg348729 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-07-30 10:11
See also issue29152 which seems to raise same concerns over this behvavior.
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81900
2021-08-31 08:16:59serhiy.storchakasetstatus: open -> closed
superseder: unittest subTest does not call addFailure
resolution: duplicate
stage: resolved
2019-07-30 10:11:56xtreaksetnosy: + ezio.melotti, xtreak, michael.foord, rbcollins
messages: + msg348729
2019-07-30 09:46:06Xavier Dollécreate