[issue29152] unittest subTest does not call addFailure

Berker Peksag report at bugs.python.org
Wed Jan 4 21:05:50 EST 2017


Berker Peksag added the comment:

Thanks for the report. That's because TestResult.addSubTest() updates TestResult.errors and TestResult.failures itself instead of calling the addError() and addFailure() methods respectively:

    if issubclass(err[0], test.failureException):
        errors = self.failures
    else:
        errors = self.errors
    errors.append((subtest, self._exc_info_to_string(err, test)))

I don't know whether it was intentional or not so I'm adding Antoine to nosy list.

(I removed 3.4 from the versions field because it's in security-fix-only mode.)

----------
components: +Library (Lib) -Tests
nosy: +berker.peksag, pitrou
stage:  -> test needed
type:  -> behavior
versions: +Python 3.6, Python 3.7 -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29152>
_______________________________________


More information about the Python-bugs-list mailing list