classification
Title: unittest: TestSuite.debug() does not like subTest()
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: unittest subTests() fails when called from debug()
View: 34900
Assigned To: Nosy List: berker.peksag, ezio.melotti, michael.foord, pitrou, rbcollins, wrohdewald
Priority: normal Keywords:

Created on 2017-02-14 07:10 by wrohdewald, last changed 2018-10-05 10:29 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
main.py wrohdewald, 2017-02-14 07:10
Messages (2)
msg287738 - (view) Author: Wolfgang Rohdewald (wrohdewald) Date: 2017-02-14 07:10
the main code is appended in main.py

if a test uses with self.subTest(), subTest() fails right in its first statement "if not self._outcome ..." because _outcome is None.

In main.py, the commented runner.run(suite) would work correctly.

If this is not meant to work, please mention it in the documentation and  improve unittest's reaction.

what I would find more logical from the users's point of view is something like

runner.debug(suite)
msg327122 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-10-05 10:29
Thanks for the report, Wolfgang. The main cause of the issue will be resolved when we merge PR 9707. I'm closing this as a duplicate of issue 34900 since the latter has already an open PR.
History
Date User Action Args
2018-10-05 10:29:40berker.peksagsetstatus: open -> closed

superseder: unittest subTests() fails when called from debug()

nosy: + berker.peksag
messages: + msg327122
resolution: duplicate
stage: resolved
2017-02-14 07:54:00serhiy.storchakasetnosy: + pitrou, rbcollins, ezio.melotti, michael.foord

type: crash -> behavior
versions: + Python 3.6, Python 3.7
2017-02-14 07:10:49wrohdewaldcreate